@@ -80,7 +80,6 @@ |
||
80 | 80 | * |
81 | 81 | * @access public |
82 | 82 | * @param string $name name of the event |
83 | - * @param Callable|PEIP\INF\Handler\Handler $listener listener to connect |
|
84 | 83 | * @return |
85 | 84 | */ |
86 | 85 | public function disconnectAll($name){ |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function connect($name, $listener){ |
48 | 48 | Test::ensureHandler($listener); |
49 | 49 | if (!$this->hasListeners($name)){ |
50 | - $this->listeners[$name] = array(); |
|
50 | + $this->listeners[$name] = array(); |
|
51 | 51 | } |
52 | 52 | $this->listeners[$name][] = $listener; |
53 | 53 | return true; |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | } |
68 | 68 | $res = false; |
69 | 69 | foreach ($this->listeners[$name] as $i => $callable){ |
70 | - if ($listener === $callable){ |
|
70 | + if ($listener === $callable){ |
|
71 | 71 | unset($this->listeners[$name][$i]); |
72 | 72 | $res = true; |
73 | - } |
|
73 | + } |
|
74 | 74 | } |
75 | 75 | return $res; |
76 | 76 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | * @see PEIP\ABS\Handler\MessageHandler::doSetInputChannel |
55 | 55 | * @access public |
56 | 56 | * @param \PEIP\INF\Channel\Channel $inputChannel the input-channel |
57 | - * @return PEIP\ABS\Handler\MessageHandler $this; |
|
57 | + * @return MessageHandler $this; |
|
58 | 58 | */ |
59 | 59 | public function setInputChannel(\PEIP\INF\Channel\Channel $inputChannel){ |
60 | 60 | $this->doSetInputChannel($inputChannel); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @return |
44 | 44 | */ |
45 | 45 | public function handle($message){ |
46 | - $this->doHandle($this->getMessageFromObject($message)); |
|
46 | + $this->doHandle($this->getMessageFromObject($message)); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | && $object->getName() == 'postSend' |
91 | 91 | && $object->hasHeader(Pipe::HEADER_MESSAGE) |
92 | 92 | && $content instanceof \PEIP\INF\Channel\PollableChannel |
93 | - ){ |
|
93 | + ){ |
|
94 | 94 | $object = $content->receive(); |
95 | 95 | } |
96 | 96 | if (!($object instanceof \PEIP\INF\Message\Message)) { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * Connects the handler to the output-channel. |
54 | 54 | * |
55 | 55 | * @access protected |
56 | - * @param \PEIP\INF\Channel\Channel $inputChannel the output-channel to connect the handler to |
|
56 | + * @param \PEIP\INF\Channel\Channel $outputChannel the output-channel to connect the handler to |
|
57 | 57 | * @return |
58 | 58 | */ |
59 | 59 | protected function doSetOutputChannel(\PEIP\INF\Channel\Channel $outputChannel){ |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | * |
163 | 163 | * @access public |
164 | 164 | * @param string $messageClass name of the message-class to create reply-messages from. |
165 | - * @return PEIP\ABS\Handler\ReplyProducingMessageHandler $this |
|
165 | + * @return ReplyProducingMessageHandler $this |
|
166 | 166 | */ |
167 | 167 | public function setMessageClass($messageClass){ |
168 | 168 | $this->messageClass = $messageClass; |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * |
196 | 196 | * @access public |
197 | 197 | * @param array $headerNames array of message-header names to look for a reply-channel |
198 | - * @return PEIP\ABS\Handler\ReplyProducingMessageHandler $this |
|
198 | + * @return ReplyProducingMessageHandler $this |
|
199 | 199 | */ |
200 | 200 | public function setReplyChannelHeaders(array $headerNames){ |
201 | 201 | $this->replyChannelHeaders = $headerNames; |
@@ -71,7 +71,6 @@ |
||
71 | 71 | * notifies all listeners on a event on a subject |
72 | 72 | * |
73 | 73 | * @access public |
74 | - * @param string $name name of the event |
|
75 | 74 | * @param mixed $subject the subject |
76 | 75 | * @return |
77 | 76 | */ |
@@ -65,7 +65,6 @@ |
||
65 | 65 | * Disconnects all listeners. |
66 | 66 | * |
67 | 67 | * @access public |
68 | - * @param Callable|PEIP\INF\Handler\Handler $listener |
|
69 | 68 | * @return void |
70 | 69 | */ |
71 | 70 | public function disconnectAll(){ |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @access public |
24 | 24 | * @param string $name name of the event |
25 | 25 | * @param \PEIP\INF\Event\Event $object an event object |
26 | - * @return boolean |
|
26 | + * @return boolean|null |
|
27 | 27 | */ |
28 | 28 | public function notify($name, $object){ |
29 | 29 | if($object instanceof \PEIP\INF\Event\Event){ |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @param array $headers headers of the event-object as key/value pairs |
54 | 54 | * @param string $eventClass event-class to create instances from |
55 | 55 | * @return |
56 | - * @see EventBuilder |
|
56 | + boolean|null @see EventBuilder |
|
57 | 57 | */ |
58 | 58 | public function buildAndNotify($name, $object, array $headers = array(), $eventClass = false, $type = false){ |
59 | 59 | if(!$this->hasListeners($name, ($object))){ |
@@ -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; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | * @access public |
39 | 39 | * @param string $name name of the event |
40 | 40 | * @param \PEIP\INF\Event\Event $object an event object |
41 | - * @return boolean |
|
41 | + * @return boolean|null |
|
42 | 42 | */ |
43 | 43 | public function notify($name, $object){ |
44 | 44 | if($object instanceof \PEIP\INF\Event\Event){ |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | * @access public |
163 | 163 | * @param $name |
164 | 164 | * @param $subject |
165 | - * @return mixed |
|
165 | + * @return \PEIP\INF\Handler\Handler |
|
166 | 166 | */ |
167 | 167 | public function notifyUntil($name, $subject){ |
168 | 168 | if($this->hasListeners($name, $subject)){ |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | * @access protected |
206 | 206 | * @param $name |
207 | 207 | * @param $object |
208 | - * @return boolean |
|
208 | + * @return boolean|null |
|
209 | 209 | */ |
210 | 210 | protected static function doNotify(array $listeners, $subject){ |
211 | 211 | foreach($listeners as $listener){ |
@@ -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 |
@@ -49,7 +49,6 @@ |
||
49 | 49 | * @access public |
50 | 50 | * @param mixed $subject the subject for the event |
51 | 51 | * @param string $name the name of the event |
52 | - * @param array|ArrayAccess $headers the headers for the event |
|
53 | 52 | */ |
54 | 53 | public function __construct($subject, $name, $parameters = array(), $type = false){ |
55 | 54 | parent::__construct($subject, Test::ensureArrayAccess($parameters)); |