Skip to content

Commit 1677fa2

Browse files
authored
Merge pull request #158 from photodude/patch-5
Fixes for False positive for function names starting with triple underscore
2 parents 6387bf3 + 740fb9f commit 1677fa2

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)