@@ -36,31 +36,35 @@ protected function removeUsedParameters(AbstractNode $node)
36
36
*/
37
37
private function removeVariablesUsedInPlugins (AbstractNode $ node )
38
38
{
39
- if ($ node instanceof MethodNode) {
40
- /** @var ClassNode $classNode */
41
- $ classNode = $ node ->getParentType ();
42
- if ($ this ->isPluginClass ($ classNode ->getNamespaceName ())) {
43
- /**
44
- * Around and After plugins has 2 required params $subject and $proceed or $result
45
- * that should be ignored
46
- */
47
- foreach (['around ' , 'after ' ] as $ pluginMethodPrefix ) {
48
- if ($ this ->isFunctionNameStartingWith ($ node , $ pluginMethodPrefix )) {
49
- $ this ->removeVariablesByCount ($ node , 2 );
39
+ if (!$ node instanceof MethodNode) {
40
+ return ;
41
+ }
42
+
43
+ /** @var ClassNode $classNode */
44
+ $ classNode = $ node ->getParentType ();
45
+ if (!$ this ->isPluginClass ($ classNode ->getNamespaceName ())) {
46
+ return ;
47
+ }
50
48
51
- break ;
52
- }
53
- }
49
+ /**
50
+ * Around and After plugins has 2 required params $subject and $proceed or $result
51
+ * that should be ignored
52
+ */
53
+ foreach (['around ' , 'after ' ] as $ pluginMethodPrefix ) {
54
+ if ($ this ->isFunctionNameStartingWith ($ node , $ pluginMethodPrefix )) {
55
+ $ this ->removeVariablesByCount ($ node , 2 );
54
56
55
- /**
56
- * Before plugins has 1 required params $subject
57
- * that should be ignored
58
- */
59
- if ($ this ->isFunctionNameStartingWith ($ node , 'before ' )) {
60
- $ this ->removeVariablesByCount ($ node , 1 );
61
- }
57
+ break ;
62
58
}
63
59
}
60
+
61
+ /**
62
+ * Before plugins has 1 required params $subject
63
+ * that should be ignored
64
+ */
65
+ if ($ this ->isFunctionNameStartingWith ($ node , 'before ' )) {
66
+ $ this ->removeVariablesByCount ($ node , 1 );
67
+ }
64
68
}
65
69
66
70
/**
0 commit comments