[TASK] Avoid implicitly nullable class method parameter in tests
With PHP 8.4 marking method parameter implicitly nullable is depreacted and will emit a `E_DEPRECATED` warning. One recommended way to resolve this, is making it explicitly nullable using the `?` nullable operator. [1] In cases, where are implicitly nullable parameter exists before not-nullable parameters in a method or constructor, making it explicitly nullable will emit a Optional parameter <paramname> declared before required parameter <paramname> is implicitly treated as a required parameter since PHP 8.0 [2]. This change adds the `?` nullable operator [1] and removes the null default value when one or more non-optional argument follows [2] to mitigate both issues. Note that the second case is a edge case in this change. This prepares the way towards PHP 8.4 compatibility and unifies towards using `?` nullable operator over union null type when possible. [1] https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated [2] https://php.watch/versions/8.0/deprecate-required-param-after-optional Resolves: #104182 Releases: main, 12.4, 11.5 Change-Id: I68362a89458117eca4f0488c67a0b9ed17e7b929 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84858 Reviewed-by:Stefan Bürk <stefan@buerk.tech> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Oliver Klee <typo3-coding@oliverklee.de> Tested-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Reviewed-by:
Oliver Klee <typo3-coding@oliverklee.de>
Showing
- typo3/sysext/backend/Tests/FunctionalDeprecated/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php 1 addition, 1 deletion...ion/TypoScript/ConditionMatching/ConditionMatcherTest.php
- typo3/sysext/backend/Tests/Unit/Controller/File/ThumbnailControllerTest.php 2 additions, 2 deletions...nd/Tests/Unit/Controller/File/ThumbnailControllerTest.php
- typo3/sysext/core/Tests/Acceptance/Support/Helper/Config.php 3 additions, 3 deletionstypo3/sysext/core/Tests/Acceptance/Support/Helper/Config.php
- typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php 1 addition, 1 deletion...tional/DataHandling/AbstractDataHandlerActionTestCase.php
- typo3/sysext/core/Tests/Functional/DataScenarios/AbstractDataHandlerActionTestCase.php 1 addition, 1 deletion...ional/DataScenarios/AbstractDataHandlerActionTestCase.php
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_foreignfield/Classes/Controller/ContentController.php 1 addition, 1 deletion...rre_foreignfield/Classes/Controller/ContentController.php
- typo3/sysext/core/Tests/Functional/SiteHandling/SiteBasedTestTrait.php 1 addition, 1 deletion...core/Tests/Functional/SiteHandling/SiteBasedTestTrait.php
- typo3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php 1 addition, 1 deletion...3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php
- typo3/sysext/core/Tests/Unit/Database/Schema/Parser/ColumnDefinitionAttributesTest.php 3 additions, 3 deletions...Database/Schema/Parser/ColumnDefinitionAttributesTest.php
- typo3/sysext/core/Tests/Unit/Database/Schema/Parser/DataTypes/DateTimeTypesTest.php 1 addition, 1 deletion...it/Database/Schema/Parser/DataTypes/DateTimeTypesTest.php
- typo3/sysext/core/Tests/Unit/Database/Schema/Parser/DataTypes/FixedPointTypesTest.php 2 additions, 2 deletions.../Database/Schema/Parser/DataTypes/FixedPointTypesTest.php
- typo3/sysext/core/Tests/Unit/Database/Schema/Parser/DataTypes/FloatingPointTypesTest.php 2 additions, 2 deletions...tabase/Schema/Parser/DataTypes/FloatingPointTypesTest.php
- typo3/sysext/core/Tests/Unit/Database/Schema/Parser/ReferenceDefinitionTest.php 3 additions, 3 deletions...s/Unit/Database/Schema/Parser/ReferenceDefinitionTest.php
- typo3/sysext/core/Tests/Unit/DependencyInjection/FailsafeContainerTest.php 1 addition, 1 deletion.../Tests/Unit/DependencyInjection/FailsafeContainerTest.php
- typo3/sysext/core/Tests/Unit/DependencyInjection/ServiceProviderCompilationPassTest.php 1 addition, 1 deletion...ependencyInjection/ServiceProviderCompilationPassTest.php
- typo3/sysext/core/Tests/Unit/EventDispatcher/ListenerProviderTest.php 3 additions, 3 deletions.../core/Tests/Unit/EventDispatcher/ListenerProviderTest.php
- typo3/sysext/core/Tests/Unit/Http/Security/ReferrerEnforcerTest.php 1 addition, 1 deletion...xt/core/Tests/Unit/Http/Security/ReferrerEnforcerTest.php
- typo3/sysext/core/Tests/Unit/Mail/Fixtures/FakeValidSpoolFixture.php 1 addition, 1 deletion...t/core/Tests/Unit/Mail/Fixtures/FakeValidSpoolFixture.php
- typo3/sysext/core/Tests/Unit/Mail/MailerTest.php 1 addition, 1 deletiontypo3/sysext/core/Tests/Unit/Mail/MailerTest.php
- typo3/sysext/core/Tests/Unit/Page/PageRendererFactoryTrait.php 2 additions, 2 deletions.../sysext/core/Tests/Unit/Page/PageRendererFactoryTrait.php
Please register or sign in to comment