From 23e1a0d36a095663fbaad8d3a1b6f6f4c4d27801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 21 Oct 2025 15:01:21 +0200 Subject: [PATCH] rector fixes --- .../Serializer/Normalizer/PhonenumberNormalizer.php | 2 +- .../Serializer/Normalizer/PersonJsonDenormalizer.php | 2 +- .../Tests/Controller/PersonIdentifierListApiControllerTest.php | 2 +- .../Validator/ValidIdentifierConstraintValidatorTest.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php index 6ce79e37d..33ba52c44 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php @@ -45,7 +45,7 @@ class PhonenumberNormalizer implements ContextAwareNormalizerInterface, Denormal try { return $this->phoneNumberUtil->parse($data, $this->defaultCarrierCode); - } catch (NumberParseException $e) { + } catch (NumberParseException) { $phonenumber = new PhoneNumber(); $phonenumber->setRawInput($data); diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonDenormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonDenormalizer.php index a65a84261..06f2e0789 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonDenormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonDenormalizer.php @@ -86,7 +86,7 @@ final class PersonJsonDenormalizer implements DenormalizerInterface, Denormalize foreach ($data['altNames'] as $altNameData) { if (!array_key_exists('key', $altNameData) || !array_key_exists('value', $altNameData) - || '' === trim($altNameData['key']) + || '' === trim((string) $altNameData['key']) ) { throw new UnexpectedValueException('format for alt name is not correct'); } diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonIdentifierListApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonIdentifierListApiControllerTest.php index 3f24a1bc9..87604e730 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonIdentifierListApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonIdentifierListApiControllerTest.php @@ -79,7 +79,7 @@ class PersonIdentifierListApiControllerTest extends TestCase return ''; } - public function validate(ExecutionContextInterface $context, PersonIdentifier $identifier, PersonIdentifierDefinition $definition): void {} + public function validate(ExecutionContextInterface $context, PersonIdentifier $identifier, PersonIdentifierDefinition $definition = null): void {} public function getDefaultValue(PersonIdentifierDefinition $definition): array { diff --git a/src/Bundle/ChillPersonBundle/Tests/PersonIdentifier/Validator/ValidIdentifierConstraintValidatorTest.php b/src/Bundle/ChillPersonBundle/Tests/PersonIdentifier/Validator/ValidIdentifierConstraintValidatorTest.php index 79139189d..9e4abff3b 100644 --- a/src/Bundle/ChillPersonBundle/Tests/PersonIdentifier/Validator/ValidIdentifierConstraintValidatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/PersonIdentifier/Validator/ValidIdentifierConstraintValidatorTest.php @@ -63,7 +63,7 @@ final class ValidIdentifierConstraintValidatorTest extends ConstraintValidatorTe // engine that returns one violation $engine = new class ([$violation]) implements PersonIdentifierEngineInterface { - public function __construct(private array $violations) {} + public function __construct(private readonly array $violations) {} public static function getName(): string {