File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento2 \Sniffs \CodeAnalysis ;
7
7
8
+ use PHP_CodeSniffer \Files \File ;
8
9
use PHP_CodeSniffer \Standards \Generic \Sniffs \CodeAnalysis \EmptyStatementSniff ;
9
10
10
11
/**
@@ -25,4 +26,17 @@ public function register()
25
26
]
26
27
);
27
28
}
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ public function process (File $ phpcsFile , $ stackPtr )
33
+ {
34
+ $ tokens = $ phpcsFile ->getTokens ();
35
+ if ($ tokens [$ stackPtr ]['code ' ] === T_FUNCTION &&
36
+ strpos ($ phpcsFile ->getDeclarationName ($ stackPtr ), 'around ' ) === 0 ) {
37
+ return ;
38
+ }
39
+
40
+ parent ::process ($ phpcsFile , $ stackPtr );
41
+ }//end process()
28
42
}
Original file line number Diff line number Diff line change @@ -74,3 +74,5 @@ if (true) {} elseif (false) {}
74
74
function emptyFunction () { /*Empty function block*/ }
75
75
76
76
function nonEmptyFunction () { return true ; }
77
+
78
+ function aroundEmptyFunction ($ foo , $ bar ) { }
You can’t perform that action at this time.
0 commit comments