Fix potential access to undefined index
This commit is contained in:
parent
7b358a144a
commit
de41002f28
@ -61,7 +61,11 @@ class EventDispatcher implements EventDispatcherInterface
|
|||||||
public function getListeners($eventName = null, $withPriorities = false)
|
public function getListeners($eventName = null, $withPriorities = false)
|
||||||
{
|
{
|
||||||
if (true === $withPriorities) {
|
if (true === $withPriorities) {
|
||||||
return $eventName ? $this->listeners[$eventName] : array_filter($this->listeners);
|
if (null !== $eventName) {
|
||||||
|
return isset($this->listeners[$eventName]) ? $this->listeners[$eventName] : array();
|
||||||
|
}
|
||||||
|
|
||||||
|
return array_filter($this->listeners);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $eventName) {
|
if (null !== $eventName) {
|
||||||
|
Reference in New Issue
Block a user