@@ -46,10 +46,10 @@ |
||
46 | 46 | if ($this->hasListeners($name, $object->getContent())) { |
47 | 47 | return self::doNotify($this->getListeners($name, $object->getContent()), $object); |
48 | 48 | } |
49 | - }else { |
|
49 | + } else { |
|
50 | 50 | throw new \InvalidArgumentException('instance of \PEIP\INF\Event\Event must contain subject'); |
51 | 51 | } |
52 | - }else { |
|
52 | + } else { |
|
53 | 53 | throw new \InvalidArgumentException('object must be instance of \PEIP\INF\Event\Event'); |
54 | 54 | } |
55 | 55 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $name = is_object($name) ? get_class($name) : (string)$name; |
23 | 23 | if (Test::assertClassOrInterfaceExists($name)) { |
24 | 24 | parent::connect($name, $listener); |
25 | - }else { |
|
25 | + } else { |
|
26 | 26 | throw new \InvalidArgumentException($name." is not an Class nor Interface"); |
27 | 27 | } |
28 | 28 | } |
@@ -24,9 +24,9 @@ |
||
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 | 31 | public function hasListeners(); |
32 | 32 |
@@ -26,11 +26,11 @@ |
||
26 | 26 | |
27 | 27 | public function disconnect($name, \PEIP\INF\Message\MessageHandler $handler); |
28 | 28 | |
29 | - public function notify( $event); |
|
29 | + public function notify($event); |
|
30 | 30 | |
31 | - public function notifyUntil( $event); |
|
31 | + public function notifyUntil($event); |
|
32 | 32 | |
33 | - public function filter( $event, $value); |
|
33 | + public function filter($event, $value); |
|
34 | 34 | |
35 | 35 | public function hasListeners($name); |
36 | 36 |
@@ -81,8 +81,8 @@ |
||
81 | 81 | * @access public |
82 | 82 | * @return ArrayAccess ArrayAccess object of headers |
83 | 83 | */ |
84 | - public function getHeaders(){ |
|
85 | - return (array) $this->headers; |
|
84 | + public function getHeaders() { |
|
85 | + return (array)$this->headers; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -134,12 +134,10 @@ |
||
134 | 134 | $res = false; |
135 | 135 | try { |
136 | 136 | $res = (string)$this->getContent(); |
137 | - } |
|
138 | - catch (\Exception $e) { |
|
137 | + } catch (\Exception $e) { |
|
139 | 138 | try { |
140 | 139 | $res = get_class($this->getContent()); |
141 | - } |
|
142 | - catch (\Exception $e) { |
|
140 | + } catch (\Exception $e) { |
|
143 | 141 | return ""; |
144 | 142 | } |
145 | 143 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | public function execute() { |
55 | 55 | if (is_callable($this->getContent())) { |
56 | 56 | return call_user_func($this->getContent()); |
57 | - }else { |
|
57 | + } else { |
|
58 | 58 | return $this->getContent()->execute(); |
59 | 59 | } |
60 | 60 | } |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | if ($static && !$reflectionFunc->isStatic()) { |
57 | 57 | throw new \InvalidArgumentException('Argument 1 passed to CallableMessageHandler::__construct is not an Callable: Method "'.$method.'" of class '.$class.' is not static.'); |
58 | 58 | } |
59 | - }else { |
|
59 | + } else { |
|
60 | 60 | $reflectionFunc = new \ReflectionFunction($this->callable); |
61 | 61 | } |
62 | 62 | $this->requiredParameters = $reflectionFunc->getNumberOfRequiredParameters(); |
63 | - }else { |
|
63 | + } else { |
|
64 | 64 | throw new \InvalidArgumentException('Argument 1 passed to CallableMessageHandler::__construct is not a Callable'); |
65 | 65 | } |
66 | 66 | } |
@@ -79,8 +79,7 @@ discard block |
||
79 | 79 | } |
80 | 80 | try { |
81 | 81 | return call_user_func_array($this->callable, array($message, $channel, $sent)); |
82 | - } |
|
83 | - catch (\Exception $e) { |
|
82 | + } catch (\Exception $e) { |
|
84 | 83 | throw new \RuntimeException('Unable to call Callable: '.$e->getMessage()); |
85 | 84 | } |
86 | 85 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | public function callService(\PEIP\INF\Message\Message $message) { |
37 | 37 | if (is_callable($this->serviceCallable)) { |
38 | 38 | $res = call_user_func_array($this->serviceCallable, $message->getContent()); |
39 | - }elseif (is_object($this->serviceCallable) && method_exists($this->serviceCallable, 'handle')) { |
|
39 | + } elseif (is_object($this->serviceCallable) && method_exists($this->serviceCallable, 'handle')) { |
|
40 | 40 | $res = call_user_func_array(array($this->serviceCallable, 'handle'), $message->getContent()); |
41 | 41 | } |
42 | 42 | return $res; |
@@ -108,7 +108,7 @@ |
||
108 | 108 | //if(\PEIP\Util\Test::assertMessage($message)){ |
109 | 109 | if ($this->getOutputChannel()) { |
110 | 110 | $this->getOutputChannel()->send($message); |
111 | - }else { |
|
111 | + } else { |
|
112 | 112 | $this->doSend($message); |
113 | 113 | } |
114 | 114 | //} |