소스 검색

[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();
         }