Skip to content

Commit

Permalink
Fixed bug #19782 : Invalid found size functions in loop when using ob…
Browse files Browse the repository at this point in the history
…ject operator
  • Loading branch information
gsherwood committed Jan 13, 2013
1 parent edb0d64 commit 42a568d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Expand Up @@ -104,6 +104,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)

$functionName = 'object.'.$functionName;
} else {
// Make sure it isn't a member var.
if ($tokens[($i - 1)]['code'] === T_OBJECT_OPERATOR) {
continue;
}

$functionName .= '()';
}

Expand Down
Expand Up @@ -49,4 +49,10 @@ for ($i = 0; $i < strlen($this->string); $i++) {
for ($i = sizeof($array); $i > 0; $i--) {
}

do {
echo $a->count;
$a->count--;
} while($a->count);

for ($i = 0; $i < $a->count; $i++) {}
?>
1 change: 1 addition & 0 deletions package.xml
Expand Up @@ -43,6 +43,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed bug #19764 : Instead of for traits throws uppercase constant name errors
- Fixed bug #19772 : PSR2_Sniffs_Namespaces_UseDeclarationSniff does not properly recognize last use
- Fixed bug #19775 : False positive in NonExecutableCode sniff when not using curly braces
- Fixed bug #19782 : Invalid found size functions in loop when using object operator
</notes>
<contents>
<dir name="/">
Expand Down

0 comments on commit 42a568d

Please sign in to comment.