Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix for Detecting class method as built-in function #10

Closed
wants to merge 1 commit into from

1 participant

This page is out of date. Refresh to see the latest.
View
2  PHP/CodeSniffer/Standards/Kohana/Sniffs/Functions/RegularExpressionSniff.php
@@ -53,7 +53,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
// Is this a function call?
$prevPtr = $phpcsFile->findPrevious(T_WHITESPACE, $stackPtr - 1, null, true);
$nextPtr = $phpcsFile->findNext(T_WHITESPACE, $stackPtr + 1, null, true);
- if ($tokens[$prevPtr]['type'] != 'T_FUNCTION'
+ if ( ($tokens[$prevPtr]['type'] != 'T_FUNCTION' && $tokens[$prevPtr]['type'] != 'T_DOUBLE_COLON')
&& $tokens[$nextPtr]['type'] == 'T_OPEN_PARENTHESIS') {
// Is this a POSIX function?
Something went wrong with that request. Please try again.