Skip to content

Commit

Permalink
UnusedPrivateElementsSniff sometimes stopped prematurely after checki…
Browse files Browse the repository at this point in the history
…ng properties with multiple modifiers
  • Loading branch information
kukulich authored and ondrejmirtes committed Apr 29, 2016
1 parent 702b989 commit 3a3d1e7
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,9 @@ private function getProperties(PHP_CodeSniffer_File $phpcsFile, array $tokens, a
while (($propertyTokenPointer = $phpcsFile->findNext(T_VARIABLE, $findPropertiesStartTokenPointer, $classToken['scope_closer'])) !== false) {
$visibilityModifiedTokenPointer = TokenHelper::findPreviousNonWhitespace($phpcsFile, $propertyTokenPointer - 1);
$visibilityModifiedToken = $tokens[$visibilityModifiedTokenPointer];
if (in_array($visibilityModifiedToken['code'], [T_PUBLIC, T_PROTECTED], true)) {
if ($visibilityModifiedToken['code'] !== T_PRIVATE) {
$findPropertiesStartTokenPointer = $propertyTokenPointer + 1;
continue;
} elseif ($visibilityModifiedToken['code'] !== T_PRIVATE) {
break;
}

$findPropertiesStartTokenPointer = $propertyTokenPointer + 1;
Expand Down

0 comments on commit 3a3d1e7

Please sign in to comment.