Skip to content

Commit 740fb9f

Browse files
authored
Fixes for False positive for function names starting with triple underscore
Fix for squizlabs/PHP_CodeSniffer#1240 Fix from squizlabs/PHP_CodeSniffer@6d3a03a
1 parent 3fc0238 commit 740fb9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Joomla/Sniffs/NamingConventions/ValidFunctionNameSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function processTokenWithinScope(PHP_CodeSniffer_File $phpcsFile, $sta
4545
$errorData = array($className . '::' . $methodName);
4646

4747
// Is this a magic method. i.e., is prefixed with "__" ?
48-
if (preg_match('|^__|', $methodName) !== 0)
48+
if (preg_match('|^__[^_]|', $methodName) !== 0)
4949
{
5050
$magicPart = strtolower(substr($methodName, 2));
5151

0 commit comments

Comments
 (0)