@@ -23,14 +23,14 @@ |
||
| 23 | 23 | |
| 24 | 24 | interface Event extends \PEIP\INF\Message\Message { |
| 25 | 25 | |
| 26 | - public function getName(); |
|
| 26 | + public function getName(); |
|
| 27 | 27 | |
| 28 | - public function setReturnValue($value); |
|
| 28 | + public function setReturnValue($value); |
|
| 29 | 29 | |
| 30 | - public function getReturnValue(); |
|
| 30 | + public function getReturnValue(); |
|
| 31 | 31 | |
| 32 | - public function setProcessed($processed); |
|
| 32 | + public function setProcessed($processed); |
|
| 33 | 33 | |
| 34 | - public function isProcessed(); |
|
| 34 | + public function isProcessed(); |
|
| 35 | 35 | |
| 36 | 36 | } |
| 37 | 37 | \ No newline at end of file |
@@ -25,11 +25,11 @@ |
||
| 25 | 25 | interface EventDispatcher |
| 26 | 26 | extends \PEIP\INF\Event\Connectable { |
| 27 | 27 | |
| 28 | - public function notify($subject); |
|
| 28 | + public function notify($subject); |
|
| 29 | 29 | |
| 30 | - public function notifyUntil($subject); |
|
| 30 | + public function notifyUntil($subject); |
|
| 31 | 31 | |
| 32 | - public function filter($subject); |
|
| 32 | + public function filter($subject); |
|
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | } |
| 36 | 36 | \ No newline at end of file |
@@ -25,13 +25,13 @@ |
||
| 25 | 25 | extends \PEIP\INF\Event\Connectable { |
| 26 | 26 | |
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * Notifies all listeners of a given event. |
|
| 30 | - * |
|
| 31 | - * @param $event A instance |
|
| 32 | - * |
|
| 33 | - * @return The instance |
|
| 34 | - */ |
|
| 28 | + /** |
|
| 29 | + * Notifies all listeners of a given event. |
|
| 30 | + * |
|
| 31 | + * @param $event A instance |
|
| 32 | + * |
|
| 33 | + * @return The instance |
|
| 34 | + */ |
|
| 35 | 35 | public function notify($name, $subject); |
| 36 | 36 | |
| 37 | 37 | |
@@ -24,12 +24,12 @@ |
||
| 24 | 24 | |
| 25 | 25 | interface ListDispatcher extends \PEIP\INF\Dispatcher\Dispatcher { |
| 26 | 26 | |
| 27 | - public function connect( $handler); |
|
| 27 | + public function connect( $handler); |
|
| 28 | 28 | |
| 29 | - public function disconnect( $handler); |
|
| 29 | + public function disconnect( $handler); |
|
| 30 | 30 | |
| 31 | - public function hasListeners(); |
|
| 31 | + public function hasListeners(); |
|
| 32 | 32 | |
| 33 | - public function getListeners(); |
|
| 33 | + public function getListeners(); |
|
| 34 | 34 | |
| 35 | 35 | } |
| 36 | 36 | \ No newline at end of file |
@@ -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; |
@@ -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 | |