Page MenuHomePhabricator

MediaWiki.Commenting.FunctionComment.PHP71NullableDocOptionalArg too strict?
Open, Needs TriagePublic

Description

I'm having a code like this:

	 * @param string[] $keys List of keys in database format.
	 * @param ?string[] $titleConds Database query condition based on current keys.
	 */
	protected function loadInfo( array $keys, ?array $titleConds = null ) {

It fails codesniffer:

18:35:49  658 | ERROR | Use nullable type("?string[]") for parameters
18:35:49      |       | documented as nullable
18:35:49      |       | (MediaWiki.Commenting.FunctionComment.PHP71NullableDocOptionalArg

If I remove = null it passes, but then other code fails because the argument is no longer optional.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 13 2020, 4:57 PM