From e018858c72b24d74df703318f48af2568581a5bc Mon Sep 17 00:00:00 2001 From: Sylvain Fabre Date: Fri, 13 Feb 2026 17:22:34 +0100 Subject: [PATCH 1/3] Apply Rector fixes and resolve PHPStan errors Co-Authored-By: Claude Opus 4.6 --- src/Test/ArrayContainSameObjectsConstraint.php | 2 +- src/Test/ConstraintValidatorTestCase.php | 4 ++-- src/Test/FieldConstraintsSetProviderTestCase.php | 2 +- src/Validator/Constraints/FloatScale.php | 1 + src/Validator/Constraints/Postal.php | 1 + tests/TestKernel.php | 1 + tests/Validator/Constraints/EmailValidatorTest.php | 4 ++-- .../EmployerIdentificationNumberValidatorTest.php | 4 ++-- tests/Validator/Constraints/EntityValidatorTest.php | 5 +++-- tests/Validator/Constraints/FloatScaleValidatorTest.php | 4 ++-- tests/Validator/Constraints/FrenchRnaValidatorTest.php | 4 ++-- tests/Validator/Constraints/FrenchSirenValidatorTest.php | 4 ++-- tests/Validator/Constraints/FrenchSiretValidatorTest.php | 4 ++-- .../LastDigitsUsSocialSecurityNumberValidatorTest.php | 4 ++-- tests/Validator/Constraints/LatitudeValidatorTest.php | 4 ++-- tests/Validator/Constraints/LongitudeValidatorTest.php | 4 ++-- tests/Validator/Constraints/MoneyValidatorTest.php | 4 ++-- tests/Validator/Constraints/PhoneLandlineValidatorTest.php | 4 ++-- tests/Validator/Constraints/PhoneMobileValidatorTest.php | 4 ++-- tests/Validator/Constraints/PhoneValidatorTest.php | 4 ++-- tests/Validator/Constraints/PostalValidatorTest.php | 4 ++-- tests/Validator/Constraints/TimezoneValidatorTest.php | 4 ++-- .../Constraints/UsSocialSecurityNumberValidatorTest.php | 4 ++-- .../ConstraintsSetProvider/Field/AmountProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/ArrayProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/BicProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/BooleanProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/CountryProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/CurrencyProviderTest.php | 2 +- .../Field/DateTimeImmutableProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/DateTimeProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/DecimalProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/EmailProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/FloatProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/FrenchRnaProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/FrenchSirenProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/FrenchSiretProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/IbanProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/IntegerProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/IpProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/JsonProviderTest.php | 2 +- .../Field/LastDigitsUsSocialSecurityNumberProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/LatitudeProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/LocaleProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/LongitudeProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/MoneyProviderTest.php | 2 +- .../Field/PhoneLandlineProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/PhoneMobileProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/PhoneProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/PostalProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/StringProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/TextProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/TimezoneProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/UlidProviderTest.php | 2 +- .../Field/UsSocialSecurityNumberProviderTest.php | 2 +- .../ConstraintsSetProvider/Field/UuidProviderTest.php | 2 +- 56 files changed, 75 insertions(+), 71 deletions(-) diff --git a/src/Test/ArrayContainSameObjectsConstraint.php b/src/Test/ArrayContainSameObjectsConstraint.php index f7fe39e..4de9484 100644 --- a/src/Test/ArrayContainSameObjectsConstraint.php +++ b/src/Test/ArrayContainSameObjectsConstraint.php @@ -22,7 +22,7 @@ public function matches(mixed $other): bool } foreach ($other as $key => $element) { - if ($element::class !== $this->expected[$key]::class) { + if ($element::class !== $this->expected[$key]::class) { /** @phpstan-ignore assoconnect.identicalClassComparison */ return false; } } diff --git a/src/Test/ConstraintValidatorTestCase.php b/src/Test/ConstraintValidatorTestCase.php index ef70c37..379ceb7 100644 --- a/src/Test/ConstraintValidatorTestCase.php +++ b/src/Test/ConstraintValidatorTestCase.php @@ -48,7 +48,7 @@ public function testValidValues(mixed $value): void /** * @return iterable */ - abstract public function providerValidValues(): iterable; + abstract public static function providerValidValues(): iterable; /** * @dataProvider providerInvalidValues @@ -68,5 +68,5 @@ public function testInvalidValues(mixed $value, string $code, string $message, ? /** * @return iterable */ - abstract public function providerInvalidValues(): iterable; + abstract public static function providerInvalidValues(): iterable; } diff --git a/src/Test/FieldConstraintsSetProviderTestCase.php b/src/Test/FieldConstraintsSetProviderTestCase.php index d5d25a9..8da5c8f 100644 --- a/src/Test/FieldConstraintsSetProviderTestCase.php +++ b/src/Test/FieldConstraintsSetProviderTestCase.php @@ -35,7 +35,7 @@ public function testGetConstraintsForType(array $fieldMapping, array $constraint } /** @return mixed[] */ - abstract public function getConstraintsForTypeProvider(): iterable; + abstract public static function getConstraintsForTypeProvider(): iterable; /** * @param mixed[] $array1 diff --git a/src/Validator/Constraints/FloatScale.php b/src/Validator/Constraints/FloatScale.php index 8de1279..6d50f3b 100644 --- a/src/Validator/Constraints/FloatScale.php +++ b/src/Validator/Constraints/FloatScale.php @@ -42,6 +42,7 @@ public function getDefaultOption(): string return 'scale'; } + /** @return list */ public function getRequiredOptions(): array { return ['scale']; diff --git a/src/Validator/Constraints/Postal.php b/src/Validator/Constraints/Postal.php index df35022..5e5360e 100644 --- a/src/Validator/Constraints/Postal.php +++ b/src/Validator/Constraints/Postal.php @@ -40,6 +40,7 @@ public function getDefaultOption(): string return 'countryPropertyPath'; } + /** @return list */ public function getRequiredOptions(): array { return ['countryPropertyPath']; diff --git a/tests/TestKernel.php b/tests/TestKernel.php index 0081cab..33d21c0 100755 --- a/tests/TestKernel.php +++ b/tests/TestKernel.php @@ -10,6 +10,7 @@ class TestKernel extends Kernel { + /** @return list<\Symfony\Component\HttpKernel\Bundle\BundleInterface> */ public function registerBundles(): iterable { return [new FrameworkBundle()]; diff --git a/tests/Validator/Constraints/EmailValidatorTest.php b/tests/Validator/Constraints/EmailValidatorTest.php index 800df2f..78c574c 100644 --- a/tests/Validator/Constraints/EmailValidatorTest.php +++ b/tests/Validator/Constraints/EmailValidatorTest.php @@ -61,7 +61,7 @@ public function testEmptyStringIsValid(): void $this->validator->validate('', new Email()); self::assertNoViolation(); } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { yield [ 'format', @@ -126,7 +126,7 @@ public function providerInvalidValues(): iterable ]; } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield ['valid@mail.com']; yield ['valid.valid@mail.com']; diff --git a/tests/Validator/Constraints/EmployerIdentificationNumberValidatorTest.php b/tests/Validator/Constraints/EmployerIdentificationNumberValidatorTest.php index bdf6de3..3efaa8f 100644 --- a/tests/Validator/Constraints/EmployerIdentificationNumberValidatorTest.php +++ b/tests/Validator/Constraints/EmployerIdentificationNumberValidatorTest.php @@ -26,7 +26,7 @@ public function createValidator(): ConstraintValidator return new EmployerIdentificationNumberValidator(); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield 'empty value' => ['']; yield 'null value' => [null]; @@ -46,7 +46,7 @@ public function testWrongTypeValue(): void $this->validator->validate($value, $this->getConstraint()); } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { yield 'EIN in wrong format (no -)' => [ '123456789', diff --git a/tests/Validator/Constraints/EntityValidatorTest.php b/tests/Validator/Constraints/EntityValidatorTest.php index 08ce465..d75a8ad 100644 --- a/tests/Validator/Constraints/EntityValidatorTest.php +++ b/tests/Validator/Constraints/EntityValidatorTest.php @@ -122,6 +122,7 @@ public function testGetConstraintsForRelationToMany(): void [new All(['constraints' => [new Type(MyEntityParent::class)]])] ); self::assertInstanceOf(All::class, $constraints[0]); + self::assertIsArray($constraints[0]->constraints); self::assertArrayContainsSameObjects( $constraints[0]->constraints, [new Type(MyEntityParent::class)] @@ -142,12 +143,12 @@ public function testGetConstraintsForUnknownField(): void $this->validator->getConstraints('class', 'unknown'); } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { return []; } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { return []; } diff --git a/tests/Validator/Constraints/FloatScaleValidatorTest.php b/tests/Validator/Constraints/FloatScaleValidatorTest.php index dc8d0f7..457bf65 100644 --- a/tests/Validator/Constraints/FloatScaleValidatorTest.php +++ b/tests/Validator/Constraints/FloatScaleValidatorTest.php @@ -25,13 +25,13 @@ public function createValidator(): ConstraintValidator return new FloatScaleValidator(); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield [2.1]; yield 'not a float value' => ['2.01']; } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { yield 'too precise' => [ 0.0001, diff --git a/tests/Validator/Constraints/FrenchRnaValidatorTest.php b/tests/Validator/Constraints/FrenchRnaValidatorTest.php index bf61f61..7e9d77a 100755 --- a/tests/Validator/Constraints/FrenchRnaValidatorTest.php +++ b/tests/Validator/Constraints/FrenchRnaValidatorTest.php @@ -25,7 +25,7 @@ public function createValidator(): ConstraintValidator return new FrenchRnaValidator(); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield 'empty RNA' => ['']; yield 'null RNA' => [null]; @@ -39,7 +39,7 @@ public function providerValidValues(): iterable yield 'Classic Corse 2A RNA' => ['W2A1000119']; } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { yield 'wrong type' => [ 42, diff --git a/tests/Validator/Constraints/FrenchSirenValidatorTest.php b/tests/Validator/Constraints/FrenchSirenValidatorTest.php index 6718e31..18d030a 100755 --- a/tests/Validator/Constraints/FrenchSirenValidatorTest.php +++ b/tests/Validator/Constraints/FrenchSirenValidatorTest.php @@ -25,14 +25,14 @@ public function createValidator(): ConstraintValidator return new FrenchSirenValidator(); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield 'empty value' => ['']; yield 'null value' => [null]; yield 'valid SIREN' => ['732829320']; } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { yield 'wrong type' => [ 42, diff --git a/tests/Validator/Constraints/FrenchSiretValidatorTest.php b/tests/Validator/Constraints/FrenchSiretValidatorTest.php index 78a9da3..63e13c9 100755 --- a/tests/Validator/Constraints/FrenchSiretValidatorTest.php +++ b/tests/Validator/Constraints/FrenchSiretValidatorTest.php @@ -25,14 +25,14 @@ public function createValidator(): ConstraintValidator return new FrenchSiretValidator(); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield 'empty value' => ['']; yield 'null value' => [null]; yield 'valid SIRET' => ['53077557600040']; } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { yield 'wrong type' => [ 42, diff --git a/tests/Validator/Constraints/LastDigitsUsSocialSecurityNumberValidatorTest.php b/tests/Validator/Constraints/LastDigitsUsSocialSecurityNumberValidatorTest.php index 06dd952..f39aaff 100644 --- a/tests/Validator/Constraints/LastDigitsUsSocialSecurityNumberValidatorTest.php +++ b/tests/Validator/Constraints/LastDigitsUsSocialSecurityNumberValidatorTest.php @@ -25,7 +25,7 @@ public function createValidator(): ConstraintValidator return new LastDigitsUsSocialSecurityNumberValidator(); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield 'empty US SSN' => ['']; yield 'null US SSN' => [null]; @@ -34,7 +34,7 @@ public function providerValidValues(): iterable yield 'an other valid US SSN: 9999' => ['9999']; } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { $invalidMessage = 'The value {{ value }} is not a valid set of ' . 'last four digits of a US Social Security Number.'; diff --git a/tests/Validator/Constraints/LatitudeValidatorTest.php b/tests/Validator/Constraints/LatitudeValidatorTest.php index 7024248..10d3290 100644 --- a/tests/Validator/Constraints/LatitudeValidatorTest.php +++ b/tests/Validator/Constraints/LatitudeValidatorTest.php @@ -29,12 +29,12 @@ public function createValidator(): ConstraintValidator return new LatitudeValidator(); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield ['18']; } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { // Skipped as it fails on lowest dependency mode // yield [ diff --git a/tests/Validator/Constraints/LongitudeValidatorTest.php b/tests/Validator/Constraints/LongitudeValidatorTest.php index 4a1bda0..6d678cd 100644 --- a/tests/Validator/Constraints/LongitudeValidatorTest.php +++ b/tests/Validator/Constraints/LongitudeValidatorTest.php @@ -29,12 +29,12 @@ public function createValidator(): ConstraintValidator return new LongitudeValidator(); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield ['18']; } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { // Skipped as it fails on parameters comparison in lowest dependency mode // yield [ diff --git a/tests/Validator/Constraints/MoneyValidatorTest.php b/tests/Validator/Constraints/MoneyValidatorTest.php index 6bad648..0ebf047 100644 --- a/tests/Validator/Constraints/MoneyValidatorTest.php +++ b/tests/Validator/Constraints/MoneyValidatorTest.php @@ -29,13 +29,13 @@ public function createValidator(): ConstraintValidator return new MoneyValidator(); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield [18]; yield [18.1]; } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { yield 'wrong type' => [ '18', diff --git a/tests/Validator/Constraints/PhoneLandlineValidatorTest.php b/tests/Validator/Constraints/PhoneLandlineValidatorTest.php index 8555116..2b488d5 100644 --- a/tests/Validator/Constraints/PhoneLandlineValidatorTest.php +++ b/tests/Validator/Constraints/PhoneLandlineValidatorTest.php @@ -26,14 +26,14 @@ public function createValidator(): ConstraintValidator return new PhoneValidator(); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield [null]; yield ['']; yield ['+33123456789']; } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { yield [ '+33623456789', diff --git a/tests/Validator/Constraints/PhoneMobileValidatorTest.php b/tests/Validator/Constraints/PhoneMobileValidatorTest.php index 732a309..18ee1a9 100644 --- a/tests/Validator/Constraints/PhoneMobileValidatorTest.php +++ b/tests/Validator/Constraints/PhoneMobileValidatorTest.php @@ -26,14 +26,14 @@ public function createValidator(): ConstraintValidator return new PhoneValidator(); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield [null]; yield ['']; yield ['+33623456789']; } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { yield [ '+33123456789', diff --git a/tests/Validator/Constraints/PhoneValidatorTest.php b/tests/Validator/Constraints/PhoneValidatorTest.php index 13c8da8..1f80733 100644 --- a/tests/Validator/Constraints/PhoneValidatorTest.php +++ b/tests/Validator/Constraints/PhoneValidatorTest.php @@ -25,7 +25,7 @@ public function createValidator(): ConstraintValidator return new PhoneValidator(); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield [null]; yield ['']; @@ -33,7 +33,7 @@ public function providerValidValues(): iterable yield ['+33623456789']; } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { yield [ '0123456789', diff --git a/tests/Validator/Constraints/PostalValidatorTest.php b/tests/Validator/Constraints/PostalValidatorTest.php index 4b7e772..98b05e1 100644 --- a/tests/Validator/Constraints/PostalValidatorTest.php +++ b/tests/Validator/Constraints/PostalValidatorTest.php @@ -157,12 +157,12 @@ public function testCountryNullWithPostalNull(): void self::assertNoViolation(); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { return []; } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { return []; } diff --git a/tests/Validator/Constraints/TimezoneValidatorTest.php b/tests/Validator/Constraints/TimezoneValidatorTest.php index a77b6bd..7c023be 100644 --- a/tests/Validator/Constraints/TimezoneValidatorTest.php +++ b/tests/Validator/Constraints/TimezoneValidatorTest.php @@ -32,7 +32,7 @@ public function testExpectsStringCompatibleType(): void $this->validator->validate(new \stdClass(), new Timezone()); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield [null]; yield ['']; @@ -41,7 +41,7 @@ public function providerValidValues(): iterable yield [new \DateTimeZone('Europe/Paris')]; } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { yield [ 'EN', diff --git a/tests/Validator/Constraints/UsSocialSecurityNumberValidatorTest.php b/tests/Validator/Constraints/UsSocialSecurityNumberValidatorTest.php index e043f9c..ad4c957 100644 --- a/tests/Validator/Constraints/UsSocialSecurityNumberValidatorTest.php +++ b/tests/Validator/Constraints/UsSocialSecurityNumberValidatorTest.php @@ -25,7 +25,7 @@ public function createValidator(): ConstraintValidator return new UsSocialSecurityNumberValidator(); } - public function providerValidValues(): iterable + public static function providerValidValues(): iterable { yield 'empty US SSN' => ['']; yield 'null US SSN' => [null]; @@ -33,7 +33,7 @@ public function providerValidValues(): iterable yield 'an other valid US SSN' => ['078051120']; } - public function providerInvalidValues(): iterable + public static function providerInvalidValues(): iterable { $invalidMessage = 'The value {{ value }} is not a valid US Social Security Number.'; diff --git a/tests/Validator/ConstraintsSetProvider/Field/AmountProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/AmountProviderTest.php index 8e4c228..dfed3ce 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/AmountProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/AmountProviderTest.php @@ -17,7 +17,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new AmountProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'amount'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/ArrayProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/ArrayProviderTest.php index d807558..23b37d7 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/ArrayProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/ArrayProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new ArrayProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'array'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/BicProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/BicProviderTest.php index 918fc34..685fb7b 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/BicProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/BicProviderTest.php @@ -17,7 +17,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new BicProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'bic'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/BooleanProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/BooleanProviderTest.php index e314ead..ec60caf 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/BooleanProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/BooleanProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new BooleanProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'boolean'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/CountryProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/CountryProviderTest.php index 853d378..0e48f01 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/CountryProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/CountryProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new CountryProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'country'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/CurrencyProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/CurrencyProviderTest.php index 0355ea7..7658b8a 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/CurrencyProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/CurrencyProviderTest.php @@ -18,7 +18,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new CurrencyProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'currency'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/DateTimeImmutableProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/DateTimeImmutableProviderTest.php index 97e3be3..4163796 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/DateTimeImmutableProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/DateTimeImmutableProviderTest.php @@ -18,7 +18,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new DateTimeImmutableProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'date_immutable'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/DateTimeProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/DateTimeProviderTest.php index 8bf6217..4cb1829 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/DateTimeProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/DateTimeProviderTest.php @@ -17,7 +17,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new DateTimeProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'date'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/DecimalProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/DecimalProviderTest.php index 142caf4..4dc6081 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/DecimalProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/DecimalProviderTest.php @@ -19,7 +19,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new DecimalProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'decimal', 'precision' => 4, 'scale' => 2], diff --git a/tests/Validator/ConstraintsSetProvider/Field/EmailProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/EmailProviderTest.php index 8e0113f..cac99d0 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/EmailProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/EmailProviderTest.php @@ -17,7 +17,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new EmailProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'email', 'length' => 10], diff --git a/tests/Validator/ConstraintsSetProvider/Field/FloatProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/FloatProviderTest.php index 26ecb1a..9496be4 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/FloatProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/FloatProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new FloatProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'float'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/FrenchRnaProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/FrenchRnaProviderTest.php index 9629ee4..bf75a66 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/FrenchRnaProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/FrenchRnaProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new FrenchRnaProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'frenchRna'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/FrenchSirenProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/FrenchSirenProviderTest.php index c0ccb4a..9c47abb 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/FrenchSirenProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/FrenchSirenProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new FrenchSirenProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'frenchSiren'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/FrenchSiretProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/FrenchSiretProviderTest.php index 17fe851..0ae2c5c 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/FrenchSiretProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/FrenchSiretProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new FrenchSiretProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'frenchSiret'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/IbanProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/IbanProviderTest.php index 6449862..c86bee0 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/IbanProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/IbanProviderTest.php @@ -17,7 +17,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new IbanProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'iban'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/IntegerProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/IntegerProviderTest.php index 54434a3..46cb250 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/IntegerProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/IntegerProviderTest.php @@ -18,7 +18,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new IntegerProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ [ diff --git a/tests/Validator/ConstraintsSetProvider/Field/IpProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/IpProviderTest.php index 480b12e..102898f 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/IpProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/IpProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new IpProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'ip'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/JsonProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/JsonProviderTest.php index 6f61b1e..0db580a 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/JsonProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/JsonProviderTest.php @@ -15,7 +15,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new JsonProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'json'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/LastDigitsUsSocialSecurityNumberProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/LastDigitsUsSocialSecurityNumberProviderTest.php index c7ef19c..2900b74 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/LastDigitsUsSocialSecurityNumberProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/LastDigitsUsSocialSecurityNumberProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new LastDigitsUsSocialSecurityNumberProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [['type' => 'lastDigitsUsSocialSecurityNumber'], [new LastDigitsUsSocialSecurityNumber()]]; } diff --git a/tests/Validator/ConstraintsSetProvider/Field/LatitudeProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/LatitudeProviderTest.php index 7a837c7..3cc9836 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/LatitudeProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/LatitudeProviderTest.php @@ -18,7 +18,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new LatitudeProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ [ diff --git a/tests/Validator/ConstraintsSetProvider/Field/LocaleProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/LocaleProviderTest.php index bdf6818..0d57a9e 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/LocaleProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/LocaleProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new LocaleProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'locale'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/LongitudeProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/LongitudeProviderTest.php index f080c99..14c0908 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/LongitudeProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/LongitudeProviderTest.php @@ -18,7 +18,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new LongitudeProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ [ diff --git a/tests/Validator/ConstraintsSetProvider/Field/MoneyProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/MoneyProviderTest.php index d1600f8..6a76a90 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/MoneyProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/MoneyProviderTest.php @@ -17,7 +17,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new MoneyProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ [ diff --git a/tests/Validator/ConstraintsSetProvider/Field/PhoneLandlineProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/PhoneLandlineProviderTest.php index f35f944..57061d6 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/PhoneLandlineProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/PhoneLandlineProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new PhoneLandlineProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'phonelandline'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/PhoneMobileProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/PhoneMobileProviderTest.php index 7cdb538..c02633e 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/PhoneMobileProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/PhoneMobileProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new PhoneMobileProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'phonemobile'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/PhoneProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/PhoneProviderTest.php index 3e62e35..98f0993 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/PhoneProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/PhoneProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new PhoneProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'phone'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/PostalProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/PostalProviderTest.php index c918090..400ffb3 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/PostalProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/PostalProviderTest.php @@ -15,7 +15,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new PostalProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'postal'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/StringProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/StringProviderTest.php index 7a7d7a7..1cdf5b3 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/StringProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/StringProviderTest.php @@ -17,7 +17,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new StringProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'string'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/TextProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/TextProviderTest.php index 3cd0714..1ba90f2 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/TextProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/TextProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new TextProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'text'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/TimezoneProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/TimezoneProviderTest.php index 58f715e..e381a3f 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/TimezoneProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/TimezoneProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new TimezoneProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'timezone'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/UlidProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/UlidProviderTest.php index 8cdbcff..9573868 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/UlidProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/UlidProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new UlidProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'ulid'], diff --git a/tests/Validator/ConstraintsSetProvider/Field/UsSocialSecurityNumberProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/UsSocialSecurityNumberProviderTest.php index d0e6390..2f04e0f 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/UsSocialSecurityNumberProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/UsSocialSecurityNumberProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new UsSocialSecurityNumberProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [['type' => 'usSocialSecurityNumber'], [new UsSocialSecurityNumber()]]; } diff --git a/tests/Validator/ConstraintsSetProvider/Field/UuidProviderTest.php b/tests/Validator/ConstraintsSetProvider/Field/UuidProviderTest.php index 4bccae8..b276892 100644 --- a/tests/Validator/ConstraintsSetProvider/Field/UuidProviderTest.php +++ b/tests/Validator/ConstraintsSetProvider/Field/UuidProviderTest.php @@ -16,7 +16,7 @@ protected function getFactory(): FieldConstraintsSetProviderInterface return new UuidProvider(); } - public function getConstraintsForTypeProvider(): iterable + public static function getConstraintsForTypeProvider(): iterable { yield [ ['type' => 'uuid'], From fcbb8497f77dcafd63adc151130a9585d8e5f6dc Mon Sep 17 00:00:00 2001 From: Sylvain Fabre Date: Sat, 14 Feb 2026 16:32:39 +0100 Subject: [PATCH 2/3] Fix ArrayContainSameObjectsConstraint typing and remove Symfony annotation overrides - Type $expected as object[] instead of mixed[] and add is_object() guard - Remove @return annotations that duplicate Symfony parent definitions - Regenerate PHPStan baseline Co-Authored-By: Claude Opus 4.6 --- phpstan-baseline.neon | 420 ++++++++++++------ .../ArrayContainSameObjectsConstraint.php | 7 +- src/Test/ConstraintValidatorTestCase.php | 4 +- .../FieldConstraintsSetProviderTestCase.php | 4 +- src/Validator/Constraints/FloatScale.php | 1 - src/Validator/Constraints/Postal.php | 1 - tests/TestKernel.php | 1 - 7 files changed, 290 insertions(+), 148 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index c95b562..5b50d6d 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,681 +1,823 @@ parameters: ignoreErrors: - - message: "#^Public property `bool` not marked as readonly\\.$#" + message: '#^Public property `bool` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEmbeddable.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$absoluteDate\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$absoluteDate\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$array\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$array\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$bic\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$bic\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$bigint\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$bigint\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$bigintUnsigned\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$bigintUnsigned\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$boolean\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$boolean\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$country\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$country\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$currency\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$currency\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$date\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$date\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$datetime\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$datetime\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$decimal\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$decimal\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$email\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$email\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$embeddable\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$embeddable\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$float\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$float\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$frenchRNA\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$frenchRNA\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$frenchSIREN\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$frenchSIREN\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$iban\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$iban\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$id\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$id\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$integer\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$integer\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$ip\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$ip\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$json\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$json\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$latitude\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$latitude\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$locale\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$locale\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$longitude\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$longitude\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$mainParent\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$mainParent\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$money\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$money\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$notNullable\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$notNullable\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$parentNotNullable\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$parentNotNullable\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$parentNullable\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$parentNullable\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$parents\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$parents\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$percent\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$percent\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$phone\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$phone\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$phonelandline\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$phonelandline\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$phonemobile\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$phonemobile\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$smallint\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$smallint\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$smallintUnsigned\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$smallintUnsigned\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$string\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$string\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$text\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$text\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$timezone\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$timezone\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$uuid\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$uuid\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity has an uninitialized property \\$uuid_binary_ordered_time\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity has an uninitialized property \$uuid_binary_ordered_time\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Property AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity\\:\\:\\$decimal cannot have float as its type \\- floats are not allowed\\.$#" + message: '#^Property AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity\:\:\$decimal cannot have float as its type \- floats are not allowed\.$#' + identifier: float.property count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Property AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity\\:\\:\\$float cannot have float as its type \\- floats are not allowed\\.$#" + message: '#^Property AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity\:\:\$float cannot have float as its type \- floats are not allowed\.$#' + identifier: float.property count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Property AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity\\:\\:\\$money cannot have float as its type \\- floats are not allowed\\.$#" + message: '#^Property AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity\:\:\$money cannot have float as its type \- floats are not allowed\.$#' + identifier: float.property count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Property AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntity\\:\\:\\$percent cannot have float as its type \\- floats are not allowed\\.$#" + message: '#^Property AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntity\:\:\$percent cannot have float as its type \- floats are not allowed\.$#' + identifier: float.property count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `absoluteDate` not marked as readonly\\.$#" + message: '#^Public property `absoluteDate` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `array` not marked as readonly\\.$#" + message: '#^Public property `array` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `bic` not marked as readonly\\.$#" + message: '#^Public property `bic` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `bigintUnsigned` not marked as readonly\\.$#" + message: '#^Public property `bigintUnsigned` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `bigint` not marked as readonly\\.$#" + message: '#^Public property `bigint` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `boolean` not marked as readonly\\.$#" + message: '#^Public property `boolean` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `country` not marked as readonly\\.$#" + message: '#^Public property `country` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `currency` not marked as readonly\\.$#" + message: '#^Public property `currency` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `date` not marked as readonly\\.$#" + message: '#^Public property `date` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `datetime` not marked as readonly\\.$#" + message: '#^Public property `datetime` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `decimal` not marked as readonly\\.$#" + message: '#^Public property `decimal` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `email` not marked as readonly\\.$#" + message: '#^Public property `email` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `embeddable` not marked as readonly\\.$#" + message: '#^Public property `embeddable` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `float` not marked as readonly\\.$#" + message: '#^Public property `float` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `frenchRNA` not marked as readonly\\.$#" + message: '#^Public property `frenchRNA` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `frenchSIREN` not marked as readonly\\.$#" + message: '#^Public property `frenchSIREN` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `iban` not marked as readonly\\.$#" + message: '#^Public property `iban` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `id` not marked as readonly\\.$#" + message: '#^Public property `id` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `integer` not marked as readonly\\.$#" + message: '#^Public property `integer` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `ip` not marked as readonly\\.$#" + message: '#^Public property `ip` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `json` not marked as readonly\\.$#" + message: '#^Public property `json` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `latitude` not marked as readonly\\.$#" + message: '#^Public property `latitude` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `locale` not marked as readonly\\.$#" + message: '#^Public property `locale` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `longitude` not marked as readonly\\.$#" + message: '#^Public property `longitude` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `mainParent` not marked as readonly\\.$#" + message: '#^Public property `mainParent` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `money` not marked as readonly\\.$#" + message: '#^Public property `money` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `notNullable` not marked as readonly\\.$#" + message: '#^Public property `notNullable` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `parentNotNullable` not marked as readonly\\.$#" + message: '#^Public property `parentNotNullable` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `parentNullable` not marked as readonly\\.$#" + message: '#^Public property `parentNullable` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `parents` not marked as readonly\\.$#" + message: '#^Public property `parents` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `percent` not marked as readonly\\.$#" + message: '#^Public property `percent` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `phone` not marked as readonly\\.$#" + message: '#^Public property `phone` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `phonelandline` not marked as readonly\\.$#" + message: '#^Public property `phonelandline` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `phonemobile` not marked as readonly\\.$#" + message: '#^Public property `phonemobile` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `smallintUnsigned` not marked as readonly\\.$#" + message: '#^Public property `smallintUnsigned` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `smallint` not marked as readonly\\.$#" + message: '#^Public property `smallint` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `string` not marked as readonly\\.$#" + message: '#^Public property `string` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `text` not marked as readonly\\.$#" + message: '#^Public property `text` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `timezone` not marked as readonly\\.$#" + message: '#^Public property `timezone` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `uuid_binary_ordered_time` not marked as readonly\\.$#" + message: '#^Public property `uuid_binary_ordered_time` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Public property `uuid` not marked as readonly\\.$#" + message: '#^Public property `uuid` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntity.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntityParent has an uninitialized property \\$id\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntityParent has an uninitialized property \$id\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntityParent.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Test\\\\Functional\\\\App\\\\Entity\\\\MyEntityParent has an uninitialized property \\$mainChild\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Test\\Functional\\App\\Entity\\MyEntityParent has an uninitialized property \$mainChild\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 path: src/Test/Functional/App/Entity/MyEntityParent.php - - message: "#^Public property `id` not marked as readonly\\.$#" + message: '#^Public property `id` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntityParent.php - - message: "#^Public property `mainChild` not marked as readonly\\.$#" + message: '#^Public property `mainChild` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Test/Functional/App/Entity/MyEntityParent.php - - message: "#^Method AssoConnect\\\\ValidatorBundle\\\\Validator\\\\Constraints\\\\Email\\:\\:__construct\\(\\) has parameter \\$normalizer with no signature specified for callable\\.$#" + message: '#^Method AssoConnect\\ValidatorBundle\\Validator\\Constraints\\Email\:\:__construct\(\) has parameter \$normalizer with no signature specified for callable\.$#' + identifier: missingType.callable count: 1 path: src/Validator/Constraints/Email.php - - message: "#^Method AssoConnect\\\\ValidatorBundle\\\\Validator\\\\Constraints\\\\Email\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Method AssoConnect\\ValidatorBundle\\Validator\\Constraints\\Email\:\:__construct\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: src/Validator/Constraints/Email.php - - message: "#^Public property `checkDNS` not marked as readonly\\.$#" + message: '#^Public property `checkDNS` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Email.php - - message: "#^Public property `dnsMessage` not marked as readonly\\.$#" + message: '#^Public property `dnsMessage` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Email.php - - message: "#^Public property `tldMessage` not marked as readonly\\.$#" + message: '#^Public property `tldMessage` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Email.php - - message: "#^Public property `message` not marked as readonly\\.$#" + message: '#^Public property `message` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/EmployerIdentificationNumber.php - - message: "#^Return type \\(string\\) of method AssoConnect\\\\ValidatorBundle\\\\Validator\\\\Constraints\\\\Entity\\:\\:getTargets\\(\\) should be covariant with return type \\('class'\\|'property'\\|array\\<'class'\\|'property'\\>\\) of method Symfony\\\\Component\\\\Validator\\\\Constraint\\:\\:getTargets\\(\\)$#" + message: '#^Method AssoConnect\\ValidatorBundle\\Validator\\Constraints\\EntityValidator\:\:getFieldAttributes\(\) has parameter \$reflectionClass with generic class ReflectionClass but does not specify its types\: T$#' + identifier: missingType.generics count: 1 - path: src/Validator/Constraints/Entity.php + path: src/Validator/Constraints/EntityValidator.php - - message: "#^Method AssoConnect\\\\ValidatorBundle\\\\Validator\\\\Constraints\\\\EntityValidator\\:\\:getFieldAttributes\\(\\) has parameter \\$reflectionClass with generic class ReflectionClass but does not specify its types\\: T$#" + message: '#^Method AssoConnect\\ValidatorBundle\\Validator\\Constraints\\EntityValidator\:\:getFieldAttributes\(\) return type with generic class ReflectionAttribute does not specify its types\: T$#' + identifier: missingType.generics count: 1 path: src/Validator/Constraints/EntityValidator.php - - message: "#^Method AssoConnect\\\\ValidatorBundle\\\\Validator\\\\Constraints\\\\EntityValidator\\:\\:getFieldAttributes\\(\\) return type with generic class ReflectionAttribute does not specify its types\\: T$#" + message: '#^Overwriting variable \$value while changing its type from BackedEnum to int\|string$#' + identifier: shipmonk.variableTypeOverwritten count: 1 path: src/Validator/Constraints/EntityValidator.php - - message: "#^Overwriting variable \\$value while changing its type from BackedEnum to int\\|string$#" + message: '#^Parameter \#1 \$constraints of class Symfony\\Component\\Validator\\Constraints\\All constructor expects array\\|Symfony\\Component\\Validator\\Constraint\|null, array\\> given\.$#' + identifier: argument.type count: 1 path: src/Validator/Constraints/EntityValidator.php - - message: "#^Parameter \\#1 \\$constraints of class Symfony\\\\Component\\\\Validator\\\\Constraints\\\\All constructor expects array\\\\|Symfony\\\\Component\\\\Validator\\\\Constraint\\|null, array\\\\> given\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Validator\\Constraints\\FloatScale has an uninitialized property \$scale\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized count: 1 - path: src/Validator/Constraints/EntityValidator.php + path: src/Validator/Constraints/FloatScale.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Validator\\\\Constraints\\\\FloatScale has an uninitialized property \\$scale\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Method getRequiredOptions always return list, but is marked as array\$#' + identifier: shipmonk.returnListNotUsed count: 1 path: src/Validator/Constraints/FloatScale.php - - message: "#^Public property `message` not marked as readonly\\.$#" + message: '#^Public property `message` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/FloatScale.php - - message: "#^Public property `scale` not marked as readonly\\.$#" + message: '#^Public property `scale` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/FloatScale.php - - message: "#^Method AssoConnect\\\\ValidatorBundle\\\\Validator\\\\Constraints\\\\FrenchRna\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Method AssoConnect\\ValidatorBundle\\Validator\\Constraints\\FrenchRna\:\:__construct\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: src/Validator/Constraints/FrenchRna.php - - message: "#^Public property `message` not marked as readonly\\.$#" + message: '#^Public property `message` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/FrenchRna.php - - message: "#^Method AssoConnect\\\\ValidatorBundle\\\\Validator\\\\Constraints\\\\FrenchSiren\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Method AssoConnect\\ValidatorBundle\\Validator\\Constraints\\FrenchSiren\:\:__construct\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: src/Validator/Constraints/FrenchSiren.php - - message: "#^Method AssoConnect\\\\ValidatorBundle\\\\Validator\\\\Constraints\\\\FrenchSiret\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Method AssoConnect\\ValidatorBundle\\Validator\\Constraints\\FrenchSiret\:\:__construct\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: src/Validator/Constraints/FrenchSiret.php - - message: "#^Public property `message` not marked as readonly\\.$#" + message: '#^Public property `message` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/LastDigitsUsSocialSecurityNumber.php - - message: "#^Property AssoConnect\\\\ValidatorBundle\\\\Validator\\\\Constraints\\\\Money\\:\\:\\$max cannot have float as its type \\- floats are not allowed\\.$#" + message: '#^Property AssoConnect\\ValidatorBundle\\Validator\\Constraints\\Money\:\:\$max cannot have float as its type \- floats are not allowed\.$#' + identifier: float.property count: 1 path: src/Validator/Constraints/Money.php - - message: "#^Property AssoConnect\\\\ValidatorBundle\\\\Validator\\\\Constraints\\\\Money\\:\\:\\$min cannot have float as its type \\- floats are not allowed\\.$#" + message: '#^Property AssoConnect\\ValidatorBundle\\Validator\\Constraints\\Money\:\:\$min cannot have float as its type \- floats are not allowed\.$#' + identifier: float.property count: 1 path: src/Validator/Constraints/Money.php - - message: "#^Public property `max` not marked as readonly\\.$#" + message: '#^Public property `max` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Money.php - - message: "#^Public property `min` not marked as readonly\\.$#" + message: '#^Public property `min` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Money.php - - message: "#^Public property `inexistantMessage` not marked as readonly\\.$#" + message: '#^Public property `inexistantMessage` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Phone.php - - message: "#^Public property `invalidCountryCodeMessage` not marked as readonly\\.$#" + message: '#^Public property `invalidCountryCodeMessage` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Phone.php - - message: "#^Public property `message` not marked as readonly\\.$#" + message: '#^Public property `message` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Phone.php - - message: "#^Public property `notIntlFormatMessage` not marked as readonly\\.$#" + message: '#^Public property `notIntlFormatMessage` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Phone.php - - message: "#^Public property `tooLongMessage` not marked as readonly\\.$#" + message: '#^Public property `tooLongMessage` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Phone.php - - message: "#^Public property `tooShortMessage` not marked as readonly\\.$#" + message: '#^Public property `tooShortMessage` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Phone.php - - message: "#^Public property `wrongTypeMessage` not marked as readonly\\.$#" + message: '#^Public property `wrongTypeMessage` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Phone.php - - message: "#^Public property `wrongTypeMessage` not marked as readonly\\.$#" + message: '#^Public property `wrongTypeMessage` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/PhoneLandline.php - - message: "#^Public property `wrongTypeMessage` not marked as readonly\\.$#" + message: '#^Public property `wrongTypeMessage` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/PhoneMobile.php - - message: "#^Class AssoConnect\\\\ValidatorBundle\\\\Validator\\\\Constraints\\\\Postal has an uninitialized property \\$countryPropertyPath\\. Give it default value or assign it in the constructor\\.$#" + message: '#^Class AssoConnect\\ValidatorBundle\\Validator\\Constraints\\Postal has an uninitialized property \$countryPropertyPath\. Give it default value or assign it in the constructor\.$#' + identifier: property.uninitialized + count: 1 + path: src/Validator/Constraints/Postal.php + + - + message: '#^Method getRequiredOptions always return list, but is marked as array\$#' + identifier: shipmonk.returnListNotUsed count: 1 path: src/Validator/Constraints/Postal.php - - message: "#^Public property `countryPropertyPath` not marked as readonly\\.$#" + message: '#^Public property `countryPropertyPath` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Postal.php - - message: "#^Public property `message` not marked as readonly\\.$#" + message: '#^Public property `message` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Postal.php - - message: "#^Public property `missingPostalCodeMessage` not marked as readonly\\.$#" + message: '#^Public property `missingPostalCodeMessage` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Postal.php - - message: "#^Public property `noPostalCodeMessage` not marked as readonly\\.$#" + message: '#^Public property `noPostalCodeMessage` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Postal.php - - message: "#^Public property `unknownCountryMessage` not marked as readonly\\.$#" + message: '#^Public property `unknownCountryMessage` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Postal.php - - message: "#^Public property `message` not marked as readonly\\.$#" + message: '#^Public property `message` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/Timezone.php - - message: "#^Public property `message` not marked as readonly\\.$#" + message: '#^Public property `message` not marked as readonly\.$#' + identifier: shipmonk.publicPropertyNotReadonly count: 1 path: src/Validator/Constraints/UsSocialSecurityNumber.php - - message: "#^Method AssoConnect\\\\ValidatorBundle\\\\Validator\\\\ConstraintsSetProvider\\\\Field\\\\IntegerProvider\\:\\:getMaxValue\\(\\) cannot have float\\|int as its return type \\- floats are not allowed\\.$#" + message: '#^Method AssoConnect\\ValidatorBundle\\Validator\\ConstraintsSetProvider\\Field\\IntegerProvider\:\:getMaxValue\(\) cannot have float\|int as its return type \- floats are not allowed\.$#' + identifier: float.type count: 1 path: src/Validator/ConstraintsSetProvider/Field/IntegerProvider.php - - message: "#^Method AssoConnect\\\\ValidatorBundle\\\\Validator\\\\ConstraintsSetProvider\\\\Field\\\\IntegerProvider\\:\\:getMinValue\\(\\) cannot have float\\|int as its return type \\- floats are not allowed\\.$#" + message: '#^Method AssoConnect\\ValidatorBundle\\Validator\\ConstraintsSetProvider\\Field\\IntegerProvider\:\:getMinValue\(\) cannot have float\|int as its return type \- floats are not allowed\.$#' + identifier: float.type count: 1 path: src/Validator/ConstraintsSetProvider/Field/IntegerProvider.php - - message: "#^Missing native return typehint float$#" + message: '#^Missing native return typehint float$#' + identifier: shipmonk.missingNativeReturnTypehint count: 2 path: src/Validator/ConstraintsSetProvider/Field/IntegerProvider.php - - message: "#^Parameter \\#1 \\$array1 of static method AssoConnect\\\\ValidatorBundle\\\\Test\\\\ConstraintValidatorTestCase\\\\:\\:assertArrayContainsSameObjects\\(\\) expects array, array\\|Symfony\\\\Component\\\\Validator\\\\Constraint given\\.$#" + message: '#^Method registerBundles always return list, but is marked as iterable\$#' + identifier: shipmonk.returnListNotUsed count: 1 - path: tests/Validator/Constraints/EntityValidatorTest.php + path: tests/TestKernel.php - - message: "#^Parameter \\#1 \\$constraints of class Symfony\\\\Component\\\\Validator\\\\Constraints\\\\All constructor expects array\\\\|Symfony\\\\Component\\\\Validator\\\\Constraint\\|null, array\\\\> given\\.$#" + message: '#^Parameter \#1 \$constraints of class Symfony\\Component\\Validator\\Constraints\\All constructor expects array\\|Symfony\\Component\\Validator\\Constraint\|null, array\\> given\.$#' + identifier: argument.type count: 1 path: tests/Validator/Constraints/EntityValidatorTest.php diff --git a/src/Test/ArrayContainSameObjectsConstraint.php b/src/Test/ArrayContainSameObjectsConstraint.php index 4de9484..a2690d8 100644 --- a/src/Test/ArrayContainSameObjectsConstraint.php +++ b/src/Test/ArrayContainSameObjectsConstraint.php @@ -9,7 +9,7 @@ class ArrayContainSameObjectsConstraint extends Constraint { /** - * @param mixed[] $expected + * @param object[] $expected */ public function __construct(private readonly array $expected) { @@ -22,7 +22,10 @@ public function matches(mixed $other): bool } foreach ($other as $key => $element) { - if ($element::class !== $this->expected[$key]::class) { /** @phpstan-ignore assoconnect.identicalClassComparison */ + if (!is_object($element)) { + return false; + } + if ($element::class !== $this->expected[$key]::class) { return false; } } diff --git a/src/Test/ConstraintValidatorTestCase.php b/src/Test/ConstraintValidatorTestCase.php index 379ceb7..d3954c0 100644 --- a/src/Test/ConstraintValidatorTestCase.php +++ b/src/Test/ConstraintValidatorTestCase.php @@ -21,8 +21,8 @@ abstract protected function getConstraint(): Constraint; abstract public function createValidator(): ConstraintValidator; /** - * @param mixed[] $array1 - * @param mixed[] $array2 + * @param object[] $array1 + * @param object[] $array2 */ protected static function assertArrayContainsSameObjects(array $array1, array $array2, string $message = ''): void { diff --git a/src/Test/FieldConstraintsSetProviderTestCase.php b/src/Test/FieldConstraintsSetProviderTestCase.php index 8da5c8f..c8cf1a1 100644 --- a/src/Test/FieldConstraintsSetProviderTestCase.php +++ b/src/Test/FieldConstraintsSetProviderTestCase.php @@ -38,8 +38,8 @@ public function testGetConstraintsForType(array $fieldMapping, array $constraint abstract public static function getConstraintsForTypeProvider(): iterable; /** - * @param mixed[] $array1 - * @param mixed[] $array2 + * @param object[] $array1 + * @param object[] $array2 */ protected static function assertArrayContainsSameObjects(array $array1, array $array2, string $message = ''): void { diff --git a/src/Validator/Constraints/FloatScale.php b/src/Validator/Constraints/FloatScale.php index 6d50f3b..8de1279 100644 --- a/src/Validator/Constraints/FloatScale.php +++ b/src/Validator/Constraints/FloatScale.php @@ -42,7 +42,6 @@ public function getDefaultOption(): string return 'scale'; } - /** @return list */ public function getRequiredOptions(): array { return ['scale']; diff --git a/src/Validator/Constraints/Postal.php b/src/Validator/Constraints/Postal.php index 5e5360e..df35022 100644 --- a/src/Validator/Constraints/Postal.php +++ b/src/Validator/Constraints/Postal.php @@ -40,7 +40,6 @@ public function getDefaultOption(): string return 'countryPropertyPath'; } - /** @return list */ public function getRequiredOptions(): array { return ['countryPropertyPath']; diff --git a/tests/TestKernel.php b/tests/TestKernel.php index 33d21c0..0081cab 100755 --- a/tests/TestKernel.php +++ b/tests/TestKernel.php @@ -10,7 +10,6 @@ class TestKernel extends Kernel { - /** @return list<\Symfony\Component\HttpKernel\Bundle\BundleInterface> */ public function registerBundles(): iterable { return [new FrameworkBundle()]; From 3eb37abdb389ec83504474b65ba4cfb5ddeeae8e Mon Sep 17 00:00:00 2001 From: Sylvain Fabre Date: Sat, 14 Feb 2026 16:38:57 +0100 Subject: [PATCH 3/3] Fix 7 PHPStan errors from baseline - EntityValidator: add generic types to ReflectionClass/ReflectionAttribute - EntityValidator: use ternary to avoid variable type overwrite for BackedEnum - EntityValidator: pass constraints array directly to All constructor - EntityValidatorTest: match All constructor fix - IntegerProvider: add native int|float return types Co-Authored-By: Claude Opus 4.6 --- phpstan-baseline.neon | 36 ------------------- src/Validator/Constraints/EntityValidator.php | 23 ++++++------ .../Field/IntegerProvider.php | 6 ++-- .../Constraints/EntityValidatorTest.php | 2 +- 4 files changed, 14 insertions(+), 53 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 5b50d6d..5af8fc5 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -582,30 +582,6 @@ parameters: count: 1 path: src/Validator/Constraints/EmployerIdentificationNumber.php - - - message: '#^Method AssoConnect\\ValidatorBundle\\Validator\\Constraints\\EntityValidator\:\:getFieldAttributes\(\) has parameter \$reflectionClass with generic class ReflectionClass but does not specify its types\: T$#' - identifier: missingType.generics - count: 1 - path: src/Validator/Constraints/EntityValidator.php - - - - message: '#^Method AssoConnect\\ValidatorBundle\\Validator\\Constraints\\EntityValidator\:\:getFieldAttributes\(\) return type with generic class ReflectionAttribute does not specify its types\: T$#' - identifier: missingType.generics - count: 1 - path: src/Validator/Constraints/EntityValidator.php - - - - message: '#^Overwriting variable \$value while changing its type from BackedEnum to int\|string$#' - identifier: shipmonk.variableTypeOverwritten - count: 1 - path: src/Validator/Constraints/EntityValidator.php - - - - message: '#^Parameter \#1 \$constraints of class Symfony\\Component\\Validator\\Constraints\\All constructor expects array\\|Symfony\\Component\\Validator\\Constraint\|null, array\\> given\.$#' - identifier: argument.type - count: 1 - path: src/Validator/Constraints/EntityValidator.php - - message: '#^Class AssoConnect\\ValidatorBundle\\Validator\\Constraints\\FloatScale has an uninitialized property \$scale\. Give it default value or assign it in the constructor\.$#' identifier: property.uninitialized @@ -804,20 +780,8 @@ parameters: count: 1 path: src/Validator/ConstraintsSetProvider/Field/IntegerProvider.php - - - message: '#^Missing native return typehint float$#' - identifier: shipmonk.missingNativeReturnTypehint - count: 2 - path: src/Validator/ConstraintsSetProvider/Field/IntegerProvider.php - - message: '#^Method registerBundles always return list, but is marked as iterable\$#' identifier: shipmonk.returnListNotUsed count: 1 path: tests/TestKernel.php - - - - message: '#^Parameter \#1 \$constraints of class Symfony\\Component\\Validator\\Constraints\\All constructor expects array\\|Symfony\\Component\\Validator\\Constraint\|null, array\\> given\.$#' - identifier: argument.type - count: 1 - path: tests/Validator/Constraints/EntityValidatorTest.php diff --git a/src/Validator/Constraints/EntityValidator.php b/src/Validator/Constraints/EntityValidator.php index e8184db..ff66da7 100644 --- a/src/Validator/Constraints/EntityValidator.php +++ b/src/Validator/Constraints/EntityValidator.php @@ -65,14 +65,14 @@ public function validate(mixed $entity, Constraint $constraint): void // (ex: path is date.start but date is NULL) try { $value = $propertyAccessor->getValue($entity, $field); - if ($value instanceof \BackedEnum) { - $value = $value->value; - } } catch (UnexpectedTypeException $exception) { $value = null; } - $validator->atPath($field)->validate($value, $constraints); + $validator->atPath($field)->validate( + $value instanceof \BackedEnum ? $value->value : $value, + $constraints + ); } } } @@ -131,13 +131,9 @@ public function getConstraints(string $class, string $field): array } } elseif (($fieldMapping['type'] & ClassMetadataInfo::TO_MANY) !== 0) { // ToMany - $constraints[] = new All( - [ - 'constraints' => [ - new Type($fieldMapping['targetEntity']), - ], - ] - ); + $constraints[] = new All([ + new Type($fieldMapping['targetEntity']), + ]); } else { // Unknown throw new \DomainException('Unknown type: ' . $fieldMapping['type']); @@ -162,7 +158,10 @@ private function checkIfFieldNeedsToBeValidated(object $entity, string $field): return true; } - /** @return \ReflectionAttribute[] */ + /** + * @param \ReflectionClass $reflectionClass + * @return \ReflectionAttribute[] + */ private function getFieldAttributes(\ReflectionClass $reflectionClass, string $field): array { if ($reflectionClass->hasProperty($field)) { diff --git a/src/Validator/ConstraintsSetProvider/Field/IntegerProvider.php b/src/Validator/ConstraintsSetProvider/Field/IntegerProvider.php index 52b2b2f..d3ee074 100644 --- a/src/Validator/ConstraintsSetProvider/Field/IntegerProvider.php +++ b/src/Validator/ConstraintsSetProvider/Field/IntegerProvider.php @@ -40,8 +40,7 @@ public function getConstraints(array $fieldMapping): array ]; } - /** @return int|float */ - private function getMinValue(string $type, bool $isSigned) + private function getMinValue(string $type, bool $isSigned): int|float { if ($isSigned) { switch ($type) { @@ -59,8 +58,7 @@ private function getMinValue(string $type, bool $isSigned) return 0; } - /** @return int|float */ - private function getMaxValue(string $type, bool $isSigned) + private function getMaxValue(string $type, bool $isSigned): int|float { if ($isSigned) { switch ($type) { diff --git a/tests/Validator/Constraints/EntityValidatorTest.php b/tests/Validator/Constraints/EntityValidatorTest.php index d75a8ad..387229e 100644 --- a/tests/Validator/Constraints/EntityValidatorTest.php +++ b/tests/Validator/Constraints/EntityValidatorTest.php @@ -119,7 +119,7 @@ public function testGetConstraintsForRelationToMany(): void $constraints = $this->validator->getConstraints('class', 'owningToMany'); self::assertArrayContainsSameObjects( $constraints, - [new All(['constraints' => [new Type(MyEntityParent::class)]])] + [new All([new Type(MyEntityParent::class)])] ); self::assertInstanceOf(All::class, $constraints[0]); self::assertIsArray($constraints[0]->constraints);