From aaced265ebe481d2acff30448cdd219eb94244b0 Mon Sep 17 00:00:00 2001 From: Dieter Holvoet Date: Wed, 24 Nov 2021 16:00:09 +0100 Subject: [PATCH] Apply phpcs fixes --- src/Drupal/Commands/core/FieldCreateCommands.php | 2 +- src/Drupal/Commands/core/LinkHooks.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Drupal/Commands/core/FieldCreateCommands.php b/src/Drupal/Commands/core/FieldCreateCommands.php index df581d88e9..f43a338f24 100644 --- a/src/Drupal/Commands/core/FieldCreateCommands.php +++ b/src/Drupal/Commands/core/FieldCreateCommands.php @@ -717,7 +717,7 @@ public static function validateRequired(?string $value): string { // FALSE is not considered as empty value because question helper use // it as negative answer on confirmation questions. - if ($value === NULL || $value === '') { + if ($value === null || $value === '') { throw new \UnexpectedValueException('This value is required.'); } diff --git a/src/Drupal/Commands/core/LinkHooks.php b/src/Drupal/Commands/core/LinkHooks.php index 0606e665cc..646e28e2e8 100644 --- a/src/Drupal/Commands/core/LinkHooks.php +++ b/src/Drupal/Commands/core/LinkHooks.php @@ -46,8 +46,7 @@ public function hookOption(Command $command, AnnotationData $annotationData): vo /** @hook on-event field-create-set-options */ public function hookSetOptions(InputInterface $input): void { - if ( - !$this->isInstalled() + if (!$this->isInstalled() || $input->getOption('field-type') !== 'link' ) { return; @@ -67,8 +66,7 @@ public function hookSetOptions(InputInterface $input): void /** @hook on-event field-create-field-config */ public function hookFieldConfig(array $values, InputInterface $input): array { - if ( - !$this->isInstalled() + if (!$this->isInstalled() || $values['field_type'] !== 'link' ) { return $values;