Skip to content

Commit

Permalink
PrefixAllGlobals: do not add invalid prefixes to the validated list
Browse files Browse the repository at this point in the history
Bug fix.

Invalid prefixes which did not pass the second validation check would still be added to the `validated_prefixes` array and the sniff would still run, even though no valid prefixes were available.
  • Loading branch information
jrfnl committed Jan 4, 2018
1 parent df05758 commit 6ce4927
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ private function validate_prefixes() {
array( $prefix )
);
unset( $this->prefixes[ $key ] );
continue;
}

// Lowercase the prefix to allow for direct compare.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function getErrorList( $testFile = 'PrefixAllGlobalsUnitTest.inc' ) {
case 'PrefixAllGlobalsUnitTest.inc':
return array(
1 => 2, // 2 x error for incorrect prefix passed.
10 => 1,
18 => 1,
21 => 1,
22 => 1,
Expand Down

0 comments on commit 6ce4927

Please sign in to comment.