Permalink
Browse files

Fixed bug #19782 : Invalid found size functions in loop when using ob…

…ject operator
  • Loading branch information...
1 parent edb0d64 commit 42a568db42cf6e85e49c7e8e972e460b44f1f121 @gsherwood gsherwood committed Jan 13, 2013
@@ -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 .= '()';
}
@@ -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++) {}
?>
View
@@ -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="/">

0 comments on commit 42a568d

Please sign in to comment.