Преглед на файлове

[EventDispatcher] fixed possible PHP warning

Fabien Potencier преди 15 години
родител
ревизия
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();
         }