From 1b99528e2b60dbb4b630652f48bc7b1e364981bd Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 1 Aug 2025 05:42:01 +0200 Subject: [PATCH 1/6] [Form] Fix interface name in Guess documentation --- Guess/Guess.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Guess/Guess.php b/Guess/Guess.php index fc19ed9ce..d8394f363 100644 --- a/Guess/Guess.php +++ b/Guess/Guess.php @@ -14,7 +14,7 @@ use Symfony\Component\Form\Exception\InvalidArgumentException; /** - * Base class for guesses made by TypeGuesserInterface implementation. + * Base class for guesses made by FormTypeGuesserInterface implementation. * * Each instance contains a confidence value about the correctness of the guess. * Thus an instance with confidence HIGH_CONFIDENCE is more likely to be From 48c966216fc56418914c81c47c459de3eb9ddc95 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 4 Aug 2025 17:09:28 +0200 Subject: [PATCH 2/6] Fix inline var annotations --- Extension/Validator/ValidatorExtension.php | 2 +- ResolvedFormType.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/Validator/ValidatorExtension.php b/Extension/Validator/ValidatorExtension.php index 51ba5258e..bfad8074f 100644 --- a/Extension/Validator/ValidatorExtension.php +++ b/Extension/Validator/ValidatorExtension.php @@ -36,6 +36,7 @@ public function __construct(ValidatorInterface $validator, bool $legacyErrorMess { $this->legacyErrorMessages = $legacyErrorMessages; + /** @var ClassMetadata $metadata */ $metadata = $validator->getMetadataFor(\Symfony\Component\Form\Form::class); // Register the form constraints in the validator programmatically. @@ -43,7 +44,6 @@ public function __construct(ValidatorInterface $validator, bool $legacyErrorMess // the DIC, where the XML file is loaded automatically. Thus the following // code must be kept synchronized with validation.xml - /** @var ClassMetadata $metadata */ $metadata->addConstraint(new Form()); $metadata->addConstraint(new Traverse(false)); diff --git a/ResolvedFormType.php b/ResolvedFormType.php index 84921b4f6..2b2f747c7 100644 --- a/ResolvedFormType.php +++ b/ResolvedFormType.php @@ -129,8 +129,8 @@ public function finishView(FormView $view, FormInterface $form, array $options) $this->innerType->finishView($view, $form, $options); + /** @var FormTypeExtensionInterface $extension */ foreach ($this->typeExtensions as $extension) { - /** @var FormTypeExtensionInterface $extension */ $extension->finishView($view, $form, $options); } } From 96a43da304f0c06316fa558e461a9b0ccf0e85b5 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 1 Aug 2025 17:44:34 +0200 Subject: [PATCH 3/6] Fix wrong boolean values --- ...ntegerToLocalizedStringTransformerTest.php | 6 ++--- .../MoneyToLocalizedStringTransformerTest.php | 10 +++---- ...NumberToLocalizedStringTransformerTest.php | 24 ++++++++--------- ...ercentToLocalizedStringTransformerTest.php | 24 ++++++++--------- Tests/Extension/Core/Type/DateTypeTest.php | 26 +++++++++---------- Tests/Extension/Core/Type/MoneyTypeTest.php | 6 ++--- Tests/Extension/Core/Type/NumberTypeTest.php | 2 +- Tests/Extension/Core/Type/PercentTypeTest.php | 2 +- 8 files changed, 50 insertions(+), 50 deletions(-) diff --git a/Tests/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformerTest.php b/Tests/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformerTest.php index 513224574..92443e201 100644 --- a/Tests/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformerTest.php +++ b/Tests/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformerTest.php @@ -95,7 +95,7 @@ public function testTransformWithRounding($input, $output, $roundingMode) public function testReverseTransform() { // Since we test against "de_AT", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); @@ -115,7 +115,7 @@ public function testReverseTransformEmpty() public function testReverseTransformWithGrouping() { // Since we test against "de_DE", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_DE'); @@ -210,7 +210,7 @@ public function testReverseTransformExpectsValidNumber() public function testReverseTransformExpectsInteger($number, $locale) { $this->expectException(TransformationFailedException::class); - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault($locale); diff --git a/Tests/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformerTest.php b/Tests/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformerTest.php index f25d49981..fe54d34cd 100644 --- a/Tests/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformerTest.php +++ b/Tests/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformerTest.php @@ -36,7 +36,7 @@ protected function tearDown(): void public function testTransform() { // Since we test against "de_AT", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); @@ -71,7 +71,7 @@ public function testTransformEmpty() public function testReverseTransform() { // Since we test against "de_AT", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); @@ -99,7 +99,7 @@ public function testReverseTransformEmpty() public function testFloatToIntConversionMismatchOnReverseTransform() { $transformer = new MoneyToLocalizedStringTransformer(null, null, null, 100); - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); $this->assertSame(3655, (int) $transformer->reverseTransform('36,55')); @@ -108,7 +108,7 @@ public function testFloatToIntConversionMismatchOnReverseTransform() public function testFloatToIntConversionMismatchOnTransform() { $transformer = new MoneyToLocalizedStringTransformer(null, null, \NumberFormatter::ROUND_DOWN, 100); - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); $this->assertSame('10,20', $transformer->transform(1020)); @@ -120,7 +120,7 @@ public function testValidNumericValuesWithNonDotDecimalPointCharacter() setlocale(\LC_ALL, 'de_AT.UTF-8'); $transformer = new MoneyToLocalizedStringTransformer(4, null, null, 100); - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); $this->assertSame('0,0035', $transformer->transform(12 / 34)); diff --git a/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php b/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php index fbb103045..5b1dd13c3 100644 --- a/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php +++ b/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php @@ -65,7 +65,7 @@ public static function provideTransformations() public function testTransform($from, $to, $locale) { // Since we test against other locales, we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault($locale); @@ -91,7 +91,7 @@ public static function provideTransformationsWithGrouping() public function testTransformWithGrouping($from, $to, $locale) { // Since we test against other locales, we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault($locale); @@ -103,7 +103,7 @@ public function testTransformWithGrouping($from, $to, $locale) public function testTransformWithScale() { // Since we test against "de_AT", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); @@ -208,7 +208,7 @@ public static function transformWithRoundingProvider() public function testTransformWithRounding($scale, $input, $output, $roundingMode) { // Since we test against "de_AT", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); @@ -220,7 +220,7 @@ public function testTransformWithRounding($scale, $input, $output, $roundingMode public function testTransformDoesNotRoundIfNoScale() { // Since we test against "de_AT", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); @@ -235,7 +235,7 @@ public function testTransformDoesNotRoundIfNoScale() public function testReverseTransform($to, $from, $locale) { // Since we test against other locales, we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault($locale); @@ -265,7 +265,7 @@ public function testReverseTransformWithGrouping($to, $from, $locale) public function testReverseTransformWithGroupingAndFixedSpaces() { // Since we test against other locales, we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('ru'); @@ -277,7 +277,7 @@ public function testReverseTransformWithGroupingAndFixedSpaces() public function testReverseTransformWithGroupingButWithoutGroupSeparator() { // Since we test against "de_AT", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); @@ -442,7 +442,7 @@ public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDotWithNoGro public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsDotButNoGroupingUsed() { // Since we test against other locales, we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('fr'); $transformer = new NumberToLocalizedStringTransformer(); @@ -588,7 +588,7 @@ public function testReverseTransformDisallowsCenteredExtraCharactersMultibyte() $this->expectException(TransformationFailedException::class); $this->expectExceptionMessage('The number contains unrecognized characters: "foo8"'); // Since we test against other locales, we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('ru'); @@ -602,7 +602,7 @@ public function testReverseTransformIgnoresTrailingSpacesInExceptionMessage() $this->expectException(TransformationFailedException::class); $this->expectExceptionMessage('The number contains unrecognized characters: "foo8"'); // Since we test against other locales, we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('ru'); @@ -625,7 +625,7 @@ public function testReverseTransformDisallowsTrailingExtraCharactersMultibyte() $this->expectException(TransformationFailedException::class); $this->expectExceptionMessage('The number contains unrecognized characters: "foo"'); // Since we test against other locales, we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('ru'); diff --git a/Tests/Extension/Core/DataTransformer/PercentToLocalizedStringTransformerTest.php b/Tests/Extension/Core/DataTransformer/PercentToLocalizedStringTransformerTest.php index 187017396..f0c400797 100644 --- a/Tests/Extension/Core/DataTransformer/PercentToLocalizedStringTransformerTest.php +++ b/Tests/Extension/Core/DataTransformer/PercentToLocalizedStringTransformerTest.php @@ -75,7 +75,7 @@ public function testTransformWithInteger() public function testTransformWithScale() { // Since we test against "de_AT", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); @@ -224,7 +224,7 @@ public function testReverseTransformWithInteger() public function testReverseTransformWithScale() { // Since we test against "de_AT", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); @@ -296,7 +296,7 @@ public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDotWithNoGro public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsDotButNoGroupingUsed() { // Since we test against other locales, we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('fr'); $transformer = new PercentToLocalizedStringTransformer(1, 'integer', \NumberFormatter::ROUND_HALFUP); @@ -375,7 +375,7 @@ public function testReverseTransformDisallowsCenteredExtraCharactersMultibyte() $this->expectException(TransformationFailedException::class); $this->expectExceptionMessage('The number contains unrecognized characters: "foo8"'); // Since we test against other locales, we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('ru'); @@ -401,7 +401,7 @@ public function testReverseTransformDisallowsTrailingExtraCharactersMultibyte() $this->expectException(TransformationFailedException::class); $this->expectExceptionMessage('The number contains unrecognized characters: "foo"'); // Since we test against other locales, we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('ru'); @@ -415,7 +415,7 @@ public function testTransformForHtml5Format() $transformer = new PercentToLocalizedStringTransformer(null, null, \NumberFormatter::ROUND_HALFUP, true); // Since we test against "de_CH", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_CH'); @@ -429,7 +429,7 @@ public function testTransformForHtml5FormatWithInteger() $transformer = new PercentToLocalizedStringTransformer(null, 'integer', \NumberFormatter::ROUND_HALFUP, true); // Since we test against "de_CH", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_CH'); @@ -440,7 +440,7 @@ public function testTransformForHtml5FormatWithInteger() public function testTransformForHtml5FormatWithScale() { // Since we test against "de_CH", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_CH'); @@ -452,7 +452,7 @@ public function testTransformForHtml5FormatWithScale() public function testReverseTransformForHtml5Format() { // Since we test against "de_CH", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_CH'); @@ -466,7 +466,7 @@ public function testReverseTransformForHtml5Format() public function testReverseTransformForHtml5FormatWithInteger() { // Since we test against "de_CH", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_CH'); @@ -481,7 +481,7 @@ public function testReverseTransformForHtml5FormatWithInteger() public function testReverseTransformForHtml5FormatWithScale() { // Since we test against "de_CH", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_CH'); @@ -546,7 +546,7 @@ class PercentToLocalizedStringTransformerWithoutGrouping extends PercentToLocali protected function getNumberFormatter(): \NumberFormatter { $formatter = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::DECIMAL); - $formatter->setAttribute(\NumberFormatter::GROUPING_USED, false); + $formatter->setAttribute(\NumberFormatter::GROUPING_USED, 0); return $formatter; } diff --git a/Tests/Extension/Core/Type/DateTypeTest.php b/Tests/Extension/Core/Type/DateTypeTest.php index 1be26c34d..56f9a737b 100644 --- a/Tests/Extension/Core/Type/DateTypeTest.php +++ b/Tests/Extension/Core/Type/DateTypeTest.php @@ -93,7 +93,7 @@ public function testSubmitFromSingleTextDateTimeWithCustomFormat() public function testSubmitFromSingleTextDateTime() { // we test against "de_DE", so we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); if (\in_array(Intl::getIcuVersion(), ['71.1', '72.1'], true)) { $this->markTestSkipped('Skipping test due to a bug in ICU 71.1/72.1.'); @@ -119,7 +119,7 @@ public function testSubmitFromSingleTextDateTime() public function testSubmitFromSingleTextDateTimeImmutable() { // we test against "de_DE", so we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); if (\in_array(Intl::getIcuVersion(), ['71.1', '72.1'], true)) { $this->markTestSkipped('Skipping test due to a bug in ICU 71.1/72.1.'); @@ -146,7 +146,7 @@ public function testSubmitFromSingleTextDateTimeImmutable() public function testSubmitFromSingleTextString() { // we test against "de_DE", so we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); if (\in_array(Intl::getIcuVersion(), ['71.1', '72.1'], true)) { $this->markTestSkipped('Skipping test due to a bug in ICU 71.1/72.1.'); @@ -172,7 +172,7 @@ public function testSubmitFromSingleTextString() public function testSubmitFromSingleTextTimestamp() { // we test against "de_DE", so we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); if (\in_array(Intl::getIcuVersion(), ['71.1', '72.1'], true)) { $this->markTestSkipped('Skipping test due to a bug in ICU 71.1/72.1.'); @@ -200,7 +200,7 @@ public function testSubmitFromSingleTextTimestamp() public function testSubmitFromSingleTextRaw() { // we test against "de_DE", so we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); if (\in_array(Intl::getIcuVersion(), ['71.1', '72.1'], true)) { $this->markTestSkipped('Skipping test due to a bug in ICU 71.1/72.1.'); @@ -232,7 +232,7 @@ public function testSubmitFromSingleTextRaw() public function testArrayDateWithReferenceDoesUseReferenceTimeOnZero() { // we test against "de_DE", so we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_DE'); @@ -505,7 +505,7 @@ public function testThrowExceptionIfDaysIsInvalid() public function testSetDataWithNegativeTimezoneOffsetStringInput() { // we test against "de_DE", so we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_DE'); @@ -528,7 +528,7 @@ public function testSetDataWithNegativeTimezoneOffsetStringInput() public function testSetDataWithNegativeTimezoneOffsetDateTimeInput() { // we test against "de_DE", so we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_DE'); @@ -607,7 +607,7 @@ public function testMonthsOptionShortFormat() public function testMonthsOptionLongFormat() { // we test against "de_AT", so we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); @@ -627,7 +627,7 @@ public function testMonthsOptionLongFormat() public function testMonthsOptionLongFormatWithDifferentTimezone() { // we test against "de_AT", so we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); @@ -713,7 +713,7 @@ public function testIsSynchronizedReturnsFalseIfChoiceAndDayEmpty() public function testPassDatePatternToView() { // we test against "de_AT", so we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); @@ -726,7 +726,7 @@ public function testPassDatePatternToView() public function testPassDatePatternToViewDifferentFormat() { // we test against "de_AT", so we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); @@ -774,7 +774,7 @@ public function testDontPassDatePatternIfText() public function testDatePatternFormatWithQuotedStrings() { // we test against "es_ES", so we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('es_ES'); diff --git a/Tests/Extension/Core/Type/MoneyTypeTest.php b/Tests/Extension/Core/Type/MoneyTypeTest.php index b00439b57..6d5521f0e 100644 --- a/Tests/Extension/Core/Type/MoneyTypeTest.php +++ b/Tests/Extension/Core/Type/MoneyTypeTest.php @@ -23,7 +23,7 @@ protected function setUp(): void { // we test against different locales, so we need the full // implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); parent::setUp(); @@ -76,7 +76,7 @@ public function testSubmitNull($expected = null, $norm = null, $view = null) public function testMoneyPatternWithoutCurrency() { - $view = $this->factory->create(static::TESTED_TYPE, null, ['currency' => false]) + $view = $this->factory->create(static::TESTED_TYPE, null, ['currency' => null]) ->createView(); $this->assertSame('{{ widget }}', $view->vars['money_pattern']); @@ -113,7 +113,7 @@ public function testDefaultFormattingWithSpecifiedRounding() public function testHtml5EnablesSpecificFormatting() { // Since we test against "de_CH", we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_CH'); diff --git a/Tests/Extension/Core/Type/NumberTypeTest.php b/Tests/Extension/Core/Type/NumberTypeTest.php index 9efe05221..132f35e4c 100644 --- a/Tests/Extension/Core/Type/NumberTypeTest.php +++ b/Tests/Extension/Core/Type/NumberTypeTest.php @@ -26,7 +26,7 @@ protected function setUp(): void parent::setUp(); // we test against "de_DE", so we need the full implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); $this->defaultLocale = \Locale::getDefault(); \Locale::setDefault('de_DE'); diff --git a/Tests/Extension/Core/Type/PercentTypeTest.php b/Tests/Extension/Core/Type/PercentTypeTest.php index 76595d79b..f6e713c56 100644 --- a/Tests/Extension/Core/Type/PercentTypeTest.php +++ b/Tests/Extension/Core/Type/PercentTypeTest.php @@ -25,7 +25,7 @@ protected function setUp(): void { // we test against different locales, so we need the full // implementation - IntlTestHelper::requireFullIntl($this, false); + IntlTestHelper::requireFullIntl($this); parent::setUp(); From 647ea288458d3ed06d33faf21331137f5e7fb957 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 5 Aug 2025 08:55:03 +0200 Subject: [PATCH 4/6] use false instead of null to hide the currency symbol This slipped in with #61296. Technically, there shouldn't be a difference but since we explicitly mention false in the documentation let's better be safe here. --- Tests/Extension/Core/Type/MoneyTypeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Extension/Core/Type/MoneyTypeTest.php b/Tests/Extension/Core/Type/MoneyTypeTest.php index 6d5521f0e..55bc8ee33 100644 --- a/Tests/Extension/Core/Type/MoneyTypeTest.php +++ b/Tests/Extension/Core/Type/MoneyTypeTest.php @@ -76,7 +76,7 @@ public function testSubmitNull($expected = null, $norm = null, $view = null) public function testMoneyPatternWithoutCurrency() { - $view = $this->factory->create(static::TESTED_TYPE, null, ['currency' => null]) + $view = $this->factory->create(static::TESTED_TYPE, null, ['currency' => false]) ->createView(); $this->assertSame('{{ widget }}', $view->vars['money_pattern']); From bcc7d5ead107cfc901bb68b3a28b10f39a997b51 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 13 Aug 2025 11:47:18 +0200 Subject: [PATCH 5/6] Remove calls to no-op functions, deprecated in PHP 8.5 --- .../DateTimeToLocalizedStringTransformerTest.php | 4 ++-- .../NumberToLocalizedStringTransformerTest.php | 5 ++--- .../PercentToLocalizedStringTransformerTest.php | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php b/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php index 6cbf6b937..c3806fd67 100644 --- a/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php +++ b/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php @@ -36,7 +36,6 @@ protected function setUp(): void // Normalize intl. configuration settings. if (\extension_loaded('intl')) { $this->initialTestCaseUseException = ini_set('intl.use_exceptions', 0); - $this->initialTestCaseErrorLevel = ini_set('intl.error_level', 0); } // Since we test against "de_AT", we need the full implementation @@ -55,7 +54,6 @@ protected function tearDown(): void if (\extension_loaded('intl')) { ini_set('intl.use_exceptions', $this->initialTestCaseUseException); - ini_set('intl.error_level', $this->initialTestCaseErrorLevel); } } @@ -346,6 +344,7 @@ public function testReverseTransformFiveDigitYearsWithTimestamp() /** * @requires extension intl + * @requires PHP < 8.5 */ public function testReverseTransformWrapsIntlErrorsWithErrorLevel() { @@ -378,6 +377,7 @@ public function testReverseTransformWrapsIntlErrorsWithExceptions() /** * @requires extension intl + * @requires PHP < 8.5 */ public function testReverseTransformWrapsIntlErrorsWithExceptionsAndErrorLevel() { diff --git a/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php b/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php index 5b1dd13c3..f22fa5da3 100644 --- a/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php +++ b/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php @@ -21,14 +21,12 @@ class NumberToLocalizedStringTransformerTest extends TestCase private string $defaultLocale; private $initialTestCaseUseException; - private $initialTestCaseErrorLevel; protected function setUp(): void { // Normalize intl. configuration settings. if (\extension_loaded('intl')) { $this->initialTestCaseUseException = ini_set('intl.use_exceptions', 0); - $this->initialTestCaseErrorLevel = ini_set('intl.error_level', 0); } $this->defaultLocale = \Locale::getDefault(); @@ -41,7 +39,6 @@ protected function tearDown(): void if (\extension_loaded('intl')) { ini_set('intl.use_exceptions', $this->initialTestCaseUseException); - ini_set('intl.error_level', $this->initialTestCaseErrorLevel); } } @@ -664,6 +661,7 @@ public function testReverseTransformENotation($output, $input) /** * @requires extension intl + * @requires PHP < 8.5 */ public function testReverseTransformWrapsIntlErrorsWithErrorLevel() { @@ -696,6 +694,7 @@ public function testReverseTransformWrapsIntlErrorsWithExceptions() /** * @requires extension intl + * @requires PHP < 8.5 */ public function testReverseTransformWrapsIntlErrorsWithExceptionsAndErrorLevel() { diff --git a/Tests/Extension/Core/DataTransformer/PercentToLocalizedStringTransformerTest.php b/Tests/Extension/Core/DataTransformer/PercentToLocalizedStringTransformerTest.php index f0c400797..ca935d564 100644 --- a/Tests/Extension/Core/DataTransformer/PercentToLocalizedStringTransformerTest.php +++ b/Tests/Extension/Core/DataTransformer/PercentToLocalizedStringTransformerTest.php @@ -21,14 +21,12 @@ class PercentToLocalizedStringTransformerTest extends TestCase private string $defaultLocale; private $initialTestCaseUseException; - private $initialTestCaseErrorLevel; protected function setUp(): void { // Normalize intl. configuration settings. if (\extension_loaded('intl')) { $this->initialTestCaseUseException = ini_set('intl.use_exceptions', 0); - $this->initialTestCaseErrorLevel = ini_set('intl.error_level', 0); } $this->defaultLocale = \Locale::getDefault(); @@ -41,7 +39,6 @@ protected function tearDown(): void if (\extension_loaded('intl')) { ini_set('intl.use_exceptions', $this->initialTestCaseUseException); - ini_set('intl.error_level', $this->initialTestCaseErrorLevel); } } @@ -492,6 +489,7 @@ public function testReverseTransformForHtml5FormatWithScale() /** * @requires extension intl + * @requires PHP < 8.5 */ public function testReverseTransformWrapsIntlErrorsWithErrorLevel() { @@ -524,6 +522,7 @@ public function testReverseTransformWrapsIntlErrorsWithExceptions() /** * @requires extension intl + * @requires PHP < 8.5 */ public function testReverseTransformWrapsIntlErrorsWithExceptionsAndErrorLevel() { From ce4d50b8779556a18f72e6122107b3db2f116140 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 15 Aug 2025 14:18:53 +0200 Subject: [PATCH 6/6] Remove direct access to internal properties cross-components --- Tests/Extension/Validator/ValidatorExtensionTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Extension/Validator/ValidatorExtensionTest.php b/Tests/Extension/Validator/ValidatorExtensionTest.php index c92bbe665..b721a1153 100644 --- a/Tests/Extension/Validator/ValidatorExtensionTest.php +++ b/Tests/Extension/Validator/ValidatorExtensionTest.php @@ -42,8 +42,8 @@ public function test2Dot5ValidationApi() $this->assertCount(1, $metadata->getConstraints()); $this->assertInstanceOf(FormConstraint::class, $metadata->getConstraints()[0]); - $this->assertSame(CascadingStrategy::NONE, $metadata->cascadingStrategy); - $this->assertSame(TraversalStrategy::NONE, $metadata->traversalStrategy); + $this->assertSame(CascadingStrategy::NONE, $metadata->getCascadingStrategy()); + $this->assertSame(TraversalStrategy::NONE, $metadata->getTraversalStrategy()); $this->assertCount(0, $metadata->getPropertyMetadata('children')); } }