Page MenuHomePhabricator

Undefined index: scope_opener in IfElseStructureSniff
Closed, ResolvedPublic

Description

FILE: ...\Anwender\Documents\xampplite\htdocs\extensions\cldr\rebuild.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
   1 | ERROR | An error occurred during processing; checking has been
     |       | aborted. The error message was: Undefined index: scope_opener
     |       | in
     |       | C:\Users\Anwender\Documents\xampplite\htdocs\extensions\cldr\vendor\mediawiki\mediawiki-codesniffer\MediaWiki\Sniffs\ControlStructures\IfElseStructureSniff.php
     |       | on line 35 (Internal.Exception)
 111 | ERROR | Only one object structure is allowed in a file
     |       | (Generic.Files.OneObjectStructurePerFile.MultipleFound)
----------------------------------------------------------------------

Caused by an elseif without {} inside a code ignore block

	if ( !strcmp( $code, 'kk' ) )
		$realCode = 'kk-cyrl';
	elseif ( !strcmp( $code, 'ku' ) )
		$realCode = 'ku-arab';
	elseif ( !strcmp( $code, 'sr' ) )
		$realCode = 'sr-ec';
	elseif ( !strcmp( $code, 'tg' ) )
		$realCode = 'tg-cyrl';
	elseif ( !strcmp( $code, 'zh' ) )
		$realCode = 'zh-hans';
	elseif ( !strcmp( $code, 'pt' ) )
		$realCode = 'pt-br';
	elseif ( !strcmp( $code, 'pt-pt' ) )
		$realCode = 'pt';
	elseif ( !strcmp( $code, 'az-arab' ) )
		$realCode = 'azb';

https://gerrit.wikimedia.org/r/#/c/400240/ has changed the sniff

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 30 2017, 11:01 PM
Umherirrender triaged this task as Medium priority.

Change 402418 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/tools/codesniffer@master] Fix Undefined index: scope_opener in IfElseStructureSniff

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

Change 402418 merged by jenkins-bot:
[mediawiki/tools/codesniffer@master] Fix Undefined index: scope_opener in IfElseStructureSniff

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

Umherirrender closed this task as Resolved.Jan 6 2018, 12:45 PM