@@ -89,7 +89,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
89
89
$ subscriberClassNameDetails ->getFullName (),
90
90
'event/Subscriber.tpl.php ' ,
91
91
[
92
- 'event ' => class_exists ($ event ) ? sprintf ('%s::class ' , $ eventClassName ) : $ this ->getEventConstant ($ event ),
92
+ 'event ' => class_exists ($ event ) ? sprintf ('%s::class ' , $ eventClassName ) : $ this ->getEventConstant ($ event ),
93
93
'import_constant_class ' => $ this ->isNeedImportConstantsClass ($ event ),
94
94
'event_full_class_name ' => $ eventFullClassName ,
95
95
'event_arg ' => $ eventClassName ? sprintf ('%s $event ' , $ eventClassName ) : '$event ' ,
@@ -113,15 +113,14 @@ public function configureDependencies(DependencyBuilder $dependencies)
113
113
114
114
/**
115
115
* @param $event
116
- * @return string
117
116
*/
118
117
private function getEventConstant ($ event ): string
119
118
{
120
119
$ constants = $ this ->getKernelEventsConstants ();
121
120
122
121
foreach ($ constants as $ name => $ value ) {
123
122
if ($ value === $ event ) {
124
- return 'KernelEvents:: ' . $ name ;
123
+ return 'KernelEvents:: ' . $ name ;
125
124
}
126
125
}
127
126
@@ -130,7 +129,6 @@ private function getEventConstant($event): string
130
129
131
130
/**
132
131
* @param $event
133
- * @return bool
134
132
*/
135
133
private function isNeedImportConstantsClass ($ event ): bool
136
134
{
@@ -145,12 +143,10 @@ private function isNeedImportConstantsClass($event): bool
145
143
return false ;
146
144
}
147
145
148
- /**
149
- * @return array
150
- */
151
146
private function getKernelEventsConstants (): array
152
147
{
153
148
$ class = new \ReflectionClass (KernelEvents::class);
149
+
154
150
return $ class ->getConstants ();
155
151
}
156
152
}
0 commit comments