8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation. 8000
There was an error while loading. Please reload this page.
1 parent 917fe53 commit 8ef3eebCopy full SHA for 8ef3eeb
Magento2/Sniffs/CodeAnalysis/EmptyBlockSniff.php
@@ -32,12 +32,8 @@ public function register()
32
public function process(File $phpcsFile, $stackPtr)
33
{
34
$tokens = $phpcsFile->getTokens();
35
- $posOfString = $phpcsFile->findNext(T_STRING, $stackPtr);
36
- $stringContent = $tokens[$posOfString]['content'];
37
- /** Check if function starts with around and also checked if string length
38
- * greater than 6 so that exact blank function name 'around()' give us warning
39
- */
40
- if (substr($stringContent, 0, 6) === "around" && strlen($stringContent) > 6) {
+ if ($tokens[$stackPtr]['code'] === T_FUNCTION &&
+ strpos($phpcsFile->getDeclarationName($stackPtr), 'around') === 0) {
41
return;
42
}
43
0 commit comments