Page MenuHomePhabricator

codesniffer detects unparenthesized ternary in mediawiki/core Article.php
Closed, ResolvedPublic

Description

FILE: includes\page\Article.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 656 | ERROR | Nested inline ternary statements, in PHP, may not
     |       | behave as you intend without parentheses
     |       | (MediaWiki.Usage.NestedInlineTernary.UnparenthesizedTernary)
----------------------------------------------------------------------

Code is:

		# Get the ParserOutput actually *displayed* here.
		# Note that $this->mParserOutput is the *current*/oldid version output.
		$pOutput = ( $outputDone instanceof ParserOutput )
			? $outputDone // object fetched by hook
			: $this->mParserOutput ?: null; // ParserOutput or null, avoid false

Was added with https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/453190/

Details

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 7 2018, 3:57 PM
Krinkle added subscribers: Tgr, Krinkle.

(Follows-up T174035)

Restricted Application added a project: Wikidata. · View Herald TranscriptSep 16 2018, 3:53 PM
Addshore moved this task from incoming to monitoring on the Wikidata board.Sep 19 2018, 7:06 AM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

(Follows-up T174035)

That'd make this an MCR concern, not an SDC one.

Change 469025 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] Follow-up T174035: Wrap inline ternary in brackets to make phpcs happy

https://gerrit.wikimedia.org/r/469025

Change 469025 merged by jenkins-bot:
[mediawiki/core@master] Follow-up T174035: Wrap inline ternary in brackets to make phpcs happy

https://gerrit.wikimedia.org/r/469025

Jdforrester-WMF closed this task as Resolved.Oct 22 2018, 4:52 PM