Permalink
Browse files

Fixed bug #19694 : Squiz.PHP.LowercasePHPFunctions incorrectly matche…

…s return by ref functions
  • Loading branch information...
1 parent 0181a09 commit f2c7e227fa217f6ddefcbc7f0e7bda931feb7027 @gsherwood gsherwood committed Nov 7, 2012
@@ -102,7 +102,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
return;
}
- $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true);
+ $prev = $phpcsFile->findPrevious(array(T_WHITESPACE, T_BITWISE_AND), ($stackPtr - 1), null, true);
if ($tokens[$prev]['code'] === T_FUNCTION) {
// Function declaration, not a function call.
return;
@@ -32,4 +32,16 @@ if (Function_Exists('myFunction') === TRUE) {
function getType() {}
$obj = new Date();
+
+$count = $object->Count();
+$count = $object::Count();
+$count = $object->count();
+$count = $object::count();
+class MyClass {
+ public function Count() {}
+}
+
+function &Sort() {
+
+}
?>
View
@@ -35,6 +35,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed bug #19691 : SubversionPropertiesSniff fails to find missing properties
-- Thanks to Kevin Winahradsky for the patch
- Fixed bug #19693 : exclude-patterns no longer work on specific messages
+ - Fixed bug #19694 : Squiz.PHP.LowercasePHPFunctions incorrectly matches return by ref functions
</notes>
<contents>
<dir name="/">

0 comments on commit f2c7e22

Please sign in to comment.