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.
- [x] `data-values/common`
- [x] `data-values/geo`
- [x] `data-values/interfaces`
- [x] `data-values/number`
- [x] `data-values/time`
- [x] `diff/diff`
- [x] `serialization/serialization`
- New versions of the libraries have been released
- [x] `data-values/common`
- [x] `data-values/geo`
- [x] `data-values/interfaces`
- [x] `data-values/number`
- [] `data-values/time`
- [] `diff/diff`
- [] `serialization/serialization`
- [] 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} and {T379509}
>>! In T376276#10306963, @Umherirrender wrote:
> Running the sniff from T362014 against `mediawiki/vendor` shows many code in different packages
> - `data-values/common` - no issue found on github (https://github.com/DataValues/Common/issues)
> - `data-values/geo` - no issue found on github (https://github.com/DataValues/Geo/issues)
> - `data-values/interfaces` - no issue found on github (https://github.com/DataValues/Interfaces/issues)
> - `data-values/number` - no issue found on github (https://github.com/wmde/Number/issues)
> - `data-values/time` - no issue found on github (https://github.com/wmde/Time/issues)
> - `diff/diff` - no issue found on github (https://github.com/wmde/Diff/issues)
> - `serialization/serialization` - no issue found on github (https://github.com/wmde/Serialization/pulls)