Просмотр исходного кода

[EventDispatcher] fixed possible PHP warning

Fabien Potencier 14 лет назад
Родитель
Сommit
2b8dfe1ccf
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      src/Symfony/Component/EventDispatcher/EventDispatcher.php

+ 3 - 0
src/Symfony/Component/EventDispatcher/EventDispatcher.php

@@ -31,6 +31,9 @@ class EventDispatcher
     public function connect($name, $listener, $priority = 0)
     {
         if (!isset($this->listeners[$name][$priority])) {
+            if (!isset($this->listeners[$name])) {
+                $this->listeners[$name] = array();
+            }
             $this->listeners[$name][$priority] = array();
         }