[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/+/84859 Reviewed-by:Anja Leichsenring <aleichsenring@ab-softlab.de> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Oliver Klee <typo3-coding@oliverklee.de> Tested-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by:
Oliver Klee <typo3-coding@oliverklee.de>
parent
c5a25313
Please register or sign in to comment