Starting in PHP 8.4, the “old-style” syntax for nullable parameters like Parser $parser = null is deprecated. It should be changed to ?Parser $parser = null – or, if the parameter should not actually have a default argument, to just ?Parser $parser. This is required for compatibility with PHP 8.4 (which is currently used by some developers and will be used in production in future) without raising tons of deprecation warnings.
Acceptance criteria:
- The libraries listed below use the latest version of the MediaWiki codesniffer config.
- data-values/common
- data-values/geo
- data-values/interfaces
- data-values/number
- data-values/time
- diff/diff
- serialization/serialization
- wmde/hamcrest-html-matchers
- New versions of the libraries have been released
- data-values/common
- data-values/geo
- data-values/interfaces
- data-values/number
- data-values/time
- diff/diff
- serialization/serialization
- wmde/hamcrest-html-matchers
- The new versions are used in Wikibase / mediawiki/vendor.git.
- The PHPCS rule MediaWiki.Usage.NullableType.ExplicitNullableTypes is not disabled in their .phpcs.xml.
- Any violations have been fixed.
cf T376276: PHP 8.4: Implicitly nullable parameter declarations deprecated and T379509: [GENERAL] Fix implicit nullable types in Wikibase