Skip to content

Commit 46fc938

Browse files
committed
Merge branch 'feature/2027-pear-validfunctionname-fix-uninitialized-offset-error' of https://github.com/jrfnl/PHP_CodeSniffer
2 parents a73f45c + a285842 commit 46fc938

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ protected function processTokenOutsideScope(File $phpcsFile, $stackPtr)
232232
if ($packagePart !== '') {
233233
// Check that each new word starts with a capital.
234234
$nameBits = explode('_', $packagePart);
235+
$nameBits = array_filter($nameBits);
235236
foreach ($nameBits as $bit) {
236237
if ($bit{0} !== strtoupper($bit{0})) {
237238
$newPackagePart = '';

src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,5 @@ $a new class {
229229
function __myFunction() {}
230230
function __my_function() {}
231231
}
232+
233+
function send_system_email__to_user($body, $recipient){}

src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ public function getErrorList()
138138
227 => 1,
139139
229 => 1,
140140
230 => 2,
141+
233 => 2,
141142
];
142143

143144
}//end getErrorList()

0 commit comments

Comments
 (0)