@@ -74,25 +74,23 @@ private function isUiDocument(\ReflectionClass $class): bool
74
74
*/
75
75
private function isControllerPlugin (\ReflectionClass $ class ): bool
76
76
{
77
- try {
78
- foreach ($ class ->getMethods (\ReflectionMethod::IS_PUBLIC ) as $ method ) {
79
- if (preg_match ('/^(after|around|before).+/i ' , $ method ->getName ())) {
80
- try {
81
- $ argument = $ method ->getParameters ()[0 ]->getClass ();
82
- } catch (\ReflectionException $ exception ) {
83
- //Non-existing class (autogenerated perhaps)
84
- continue ;
85
- }
86
- $ isAction = $ argument ->isSubclassOf (\Magento \Framework \App \ActionInterface::class)
87
- || $ argument ->getName () === \Magento \Framework \App \ActionInterface::class;
88
- if ($ isAction ) {
89
- return true ;
90
- }
77
+ foreach ($ class ->getMethods (\ReflectionMethod::IS_PUBLIC ) as $ method ) {
78
+ if (preg_match ('/^(after|around|before).+/i ' , $ method ->getName ())) {
79
+ try {
80
+ $ argument = $ method ->getParameters ()[0 ]->getClass ();
81
+ } catch (\ReflectionException $ exception ) {
82
+ //Non-existing class (autogenerated perhaps)
83
+ continue ;
84
+ }
85
+ $ isAction = $ argument ->isSubclassOf (\Magento \Framework \App \ActionInterface::class)
86
+ || $ argument ->getName () === \Magento \Framework \App \ActionInterface::class;
87
+ if ($ isAction ) {
88
+ return true ;
91
89
}
92
90
}
93
- } catch (\Throwable $ exception ) {
94
- return false ;
95
91
}
92
+
93
+ return false ;
96
94
}
97
95
98
96
/**
@@ -103,25 +101,23 @@ private function isControllerPlugin(\ReflectionClass $class): bool
103
101
*/
104
102
private function isBlockPlugin (\ReflectionClass $ class ): bool
105
103
{
106
- try {
107
- foreach ($ class ->getMethods (\ReflectionMethod::IS_PUBLIC ) as $ method ) {
108
- if (preg_match ('/^(after|around|before).+/i ' , $ method ->getName ())) {
109
- try {
110
- $ argument = $ method ->getParameters ()[0 ]->getClass ();
111
- } catch (\ReflectionException $ exception ) {
112
- //Non-existing class (autogenerated perhaps)
113
- continue ;
114
- }
115
- $ isBlock = $ argument ->isSubclassOf (\Magento \Framework \View \Element \BlockInterface::class)
116
- || $ argument ->getName () === \Magento \Framework \View \Element \BlockInterface::class;
117
- if ($ isBlock ) {
118
- return true ;
119
- }
104
+ foreach ($ class ->getMethods (\ReflectionMethod::IS_PUBLIC ) as $ method ) {
105
+ if (preg_match ('/^(after|around|before).+/i ' , $ method ->getName ())) {
106
+ try {
107
+ $ argument = $ method ->getParameters ()[0 ]->getClass ();
108
+ } catch (\ReflectionException $ exception ) {
109
+ //Non-existing class (autogenerated perhaps)
110
+ continue ;
111
+ }
112
+ $ isBlock = $ argument ->isSubclassOf (\Magento \Framework \View \Element \BlockInterface::class)
113
+ || $ argument ->getName () === \Magento \Framework \View \Element \BlockInterface::class;
114
+ if ($ isBlock ) {
115
+ return true ;
120
116
}
121
117
}
122
- } catch (\Throwable $ exception ) {
123
- return false ;
124
118
}
119
+
120
+ return false ;
125
121
}
126
122
127
123
/**
0 commit comments