@@ -49,10 +49,10 @@ |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | - * @access public |
|
53 | - * @param $observer |
|
54 | - * @return |
|
55 | - */ |
|
52 | + * @access public |
|
53 | + * @param $observer |
|
54 | + * @return |
|
55 | + */ |
|
56 | 56 | public function addObserver(\PEIP\INF\Event\Observer $observer){ |
57 | 57 | $this->observers[] = $observer; |
58 | 58 | } |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | $this->getListeners( |
33 | 33 | $name, |
34 | 34 | $object |
35 | - ), |
|
36 | - $object->getContent() |
|
37 | - ); |
|
35 | + ), |
|
36 | + $object->getContent() |
|
37 | + ); |
|
38 | 38 | }else{ |
39 | 39 | throw new \InvalidArgumentException('instance of \PEIP\INF\Event\Event must contain subject'); |
40 | 40 | } |
@@ -43,18 +43,18 @@ discard block |
||
43 | 43 | } |
44 | 44 | } //put your code here |
45 | 45 | |
46 | - /** |
|
47 | - * Creates an event-object with given object as content/subject and notifies |
|
48 | - * all registers listeners of the event. |
|
49 | - * |
|
50 | - * @access public |
|
51 | - * @param string $name name of the event |
|
52 | - * @param object $object the subject of the event |
|
53 | - * @param array $headers headers of the event-object as key/value pairs |
|
54 | - * @param string $eventClass event-class to create instances from |
|
55 | - * @return |
|
56 | - * @see EventBuilder |
|
57 | - */ |
|
46 | + /** |
|
47 | + * Creates an event-object with given object as content/subject and notifies |
|
48 | + * all registers listeners of the event. |
|
49 | + * |
|
50 | + * @access public |
|
51 | + * @param string $name name of the event |
|
52 | + * @param object $object the subject of the event |
|
53 | + * @param array $headers headers of the event-object as key/value pairs |
|
54 | + * @param string $eventClass event-class to create instances from |
|
55 | + * @return |
|
56 | + * @see EventBuilder |
|
57 | + */ |
|
58 | 58 | public function buildAndNotify($name, $object, array $headers = array(), $eventClass = false, $type = false){ |
59 | 59 | if(!$this->hasListeners($name, ($object))){ |
60 | 60 | return false; |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | Reflection_Pool::getInstance( |
67 | 67 | $object->getContent() |
68 | 68 | ) |
69 | - ), |
|
70 | - $object |
|
71 | - ); |
|
69 | + ), |
|
70 | + $object |
|
71 | + ); |
|
72 | 72 | }else{ |
73 | 73 | throw new \InvalidArgumentException('instance of \PEIP\INF\Event\Event must contain subject'); |
74 | 74 | } |
@@ -77,18 +77,18 @@ discard block |
||
77 | 77 | } |
78 | 78 | } //put your code here |
79 | 79 | |
80 | - /** |
|
81 | - * Creates an event-object with given object as content/subject and notifies |
|
82 | - * all registers listeners of the event. |
|
83 | - * |
|
84 | - * @access public |
|
85 | - * @param string $name name of the event |
|
86 | - * @param object $object the subject of the event |
|
87 | - * @param array $headers headers of the event-object as key/value pairs |
|
88 | - * @param string $eventClass event-class to create instances from |
|
89 | - * @return |
|
90 | - * @see EventBuilder |
|
91 | - */ |
|
80 | + /** |
|
81 | + * Creates an event-object with given object as content/subject and notifies |
|
82 | + * all registers listeners of the event. |
|
83 | + * |
|
84 | + * @access public |
|
85 | + * @param string $name name of the event |
|
86 | + * @param object $object the subject of the event |
|
87 | + * @param array $headers headers of the event-object as key/value pairs |
|
88 | + * @param string $eventClass event-class to create instances from |
|
89 | + * @return |
|
90 | + * @see EventBuilder |
|
91 | + */ |
|
92 | 92 | public function buildAndNotify($name, $object, array $headers = array(), $eventClass = false, $type = false){ |
93 | 93 | if(!$this->hasListeners($name, ($object))){ |
94 | 94 | return false; |
@@ -209,11 +209,11 @@ |
||
209 | 209 | */ |
210 | 210 | protected static function doNotify(array $listeners, $subject){ |
211 | 211 | foreach($listeners as $listener){ |
212 | - if($listener instanceof \PEIP\INF\Handler\Handler){ |
|
212 | + if($listener instanceof \PEIP\INF\Handler\Handler){ |
|
213 | 213 | $listener->handle($subject); |
214 | - }elseif(is_callable($listener)){ |
|
215 | - call_user_func($listener, $subject); |
|
216 | - } |
|
214 | + }elseif(is_callable($listener)){ |
|
215 | + call_user_func($listener, $subject); |
|
216 | + } |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 |