[EventDispatcher] Fix interface name used in error messages
This commit is contained in:
parent
4559a656cc
commit
38cad41a0a
@ -58,13 +58,13 @@ final class LegacyEventDispatcherProxy implements EventDispatcherInterface
|
|||||||
if (\is_object($event)) {
|
if (\is_object($event)) {
|
||||||
$eventName = $eventName ?? \get_class($event);
|
$eventName = $eventName ?? \get_class($event);
|
||||||
} else {
|
} else {
|
||||||
@trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead.', EventDispatcherInterface::class), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead.', ContractsEventDispatcherInterface::class), E_USER_DEPRECATED);
|
||||||
$swap = $event;
|
$swap = $event;
|
||||||
$event = $eventName ?? new Event();
|
$event = $eventName ?? new Event();
|
||||||
$eventName = $swap;
|
$eventName = $swap;
|
||||||
|
|
||||||
if (!$event instanceof Event) {
|
if (!$event instanceof Event) {
|
||||||
throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an instance of %s, %s given.', EventDispatcherInterface::class, Event::class, \is_object($event) ? \get_class($event) : \gettype($event)));
|
throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an instance of %s, %s given.', ContractsEventDispatcherInterface::class, Event::class, \is_object($event) ? \get_class($event) : \gettype($event)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user