File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 44
55namespace Symplify \PHPStanRules \Rules \Symfony ;
66
7+ use PhpParser \Node \Name ;
78use PhpParser \Node ;
89use PhpParser \Node \Stmt \Class_ ;
910use PHPStan \Analyser \Scope ;
@@ -134,11 +135,9 @@ private function isFormEventsListener(Class_ $class): bool
134135 }
135136
136137 foreach ($ classMethod ->params as $ param ) {
137- if ($ param ->type instanceof Node \ Name) {
138+ if ($ param ->type instanceof Name && str_starts_with ( $ param -> type -> toString (), ' Symfony\Component\Form\Event \\' ) ) {
138139
139- if (str_starts_with ($ param ->type ->toString (), 'Symfony\Component\Form\Event \\' )) {
140- return true ;
141- }
140+ return true ;
142141 }
143142 }
144143 }
@@ -148,7 +147,7 @@ private function isFormEventsListener(Class_ $class): bool
148147
149148 private function isSecurityListener (Class_ $ class ): bool
150149 {
151- if (! $ class ->extends instanceof Node \ Name) {
150+ if (! $ class ->extends instanceof Name) {
152151 return false ;
153152 }
154153
You can’t perform that action at this time.
0 commit comments