You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!$r->hasMethod($event['method']) && $r->hasMethod('__invoke')) {
91
+
$event['method'] = '__invoke';
92
+
}
93
+
}
94
+
} else {
95
+
if (!$r->implementsInterface(EventListenerInterface::class)) {
96
+
thrownewInvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "%s" tags or implements the EventListenerInterface interface .', $id, $this->listenerTag));
97
+
}
87
98
88
-
if (isset($this->hotPathEvents[$event['event']])) {
thrownew \InvalidArgumentException(sprintf('Invalid EventListener "%s": class "%s" must have an "__invoke()" method.', $serviceId, $handlerClass->getName()));
137
+
}
138
+
139
+
$parameters = $method->getParameters();
140
+
if (1 > \count($parameters)) {
141
+
thrownew \InvalidArgumentException(sprintf('Invalid EventListener "%s": method "%s::__invoke()" must have, at least, one argument corresponding to the event it handles.', $serviceId, $handlerClass->getName()));
142
+
}
143
+
144
+
if (!$type = $parameters[0]->getType()) {
145
+
thrownew \InvalidArgumentException(sprintf('Invalid EventListener "%s": argument "$%s" of method "%s::__invoke()" must have a type-hint corresponding to the event class it handles.', $serviceId, $parameters[0]->getName(), $handlerClass->getName()));
146
+
}
147
+
148
+
if ($type->isBuiltin()) {
149
+
thrownew \InvalidArgumentException(sprintf('Invalid EventListener "%s": type-hint of argument "$%s" in method "%s::__invoke()" must be a class, "%s" given.', $serviceId, $parameters[0]->getName(), $handlerClass->getName(), $type));
0 commit comments