Skip to content

Commit 8ef3eeb

Browse files
Feedback changes
1 parent 917fe53 commit 8ef3eeb

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Magento2/Sniffs/CodeAnalysis/EmptyBlockSniff.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,8 @@ public function register()
3232
public function process(File $phpcsFile, $stackPtr)
3333
{
3434
$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) {
35+
if ($tokens[$stackPtr]['code'] === T_FUNCTION &&
36+
strpos($phpcsFile->getDeclarationName($stackPtr), 'around') === 0) {
4137
return;
4238
}
4339

0 commit comments

Comments
 (0)