@@ -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 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * @param string $nodeName the name of the node |
| 70 | 70 | * @param callable $callable a callable which creates instances for node-name |
| 71 | 71 | */ |
| 72 | - public function registerNodeBuilder($nodeName, $callable){ |
|
| 72 | + public function registerNodeBuilder($nodeName, $callable) { |
|
| 73 | 73 | $this->nodeBuilders[$nodeName] = $callable; |
| 74 | 74 | } |
| 75 | 75 | /** |
@@ -82,16 +82,16 @@ discard block |
||
| 82 | 82 | * @see XMLContext::includeContext |
| 83 | 83 | * @access protected |
| 84 | 84 | */ |
| 85 | - protected function initNodeBuilders(){ |
|
| 85 | + protected function initNodeBuilders() { |
|
| 86 | 86 | $builders = array( |
| 87 | 87 | 'service' => 'initService' |
| 88 | 88 | ); |
| 89 | - foreach($builders as $nodeName => $method){ |
|
| 89 | + foreach ($builders as $nodeName => $method) { |
|
| 90 | 90 | $this->registerNodeBuilder($nodeName, array($this, $method)); |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - public function addConfig($config){ |
|
| 94 | + public function addConfig($config) { |
|
| 95 | 95 | $this->doFireEvent( |
| 96 | 96 | self::EVENT_BEFORE_ADD_CONFIG, |
| 97 | 97 | array( |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | if ($this->hasService($key)) { |
| 119 | 119 | $service = $this->getService($key); |
| 120 | - }else { |
|
| 120 | + } else { |
|
| 121 | 121 | $service = $this->createService($key); |
| 122 | 122 | } |
| 123 | 123 | |
@@ -149,11 +149,11 @@ discard block |
||
| 149 | 149 | )); |
| 150 | 150 | |
| 151 | 151 | return $node; |
| 152 | - }else { |
|
| 152 | + } else { |
|
| 153 | 153 | $errorMessage = 'COULD NOT BUILD NODE FOR KEY: '.$key; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - }else { |
|
| 156 | + } else { |
|
| 157 | 157 | $errorMessage = 'NO CONFIG FOR KEY: '.$key; |
| 158 | 158 | } |
| 159 | 159 | $this->doFireEvent(self::EVENT_CREATE_SERVICE_ERROR, array( |
@@ -197,10 +197,10 @@ discard block |
||
| 197 | 197 | self::HEADER_NODE => $nodeInstance |
| 198 | 198 | )); |
| 199 | 199 | return $nodeInstance; |
| 200 | - }else { |
|
| 200 | + } else { |
|
| 201 | 201 | $errorMessage = 'BUILDER RETURNED NO OBJECT FOR NODE-TYPE: '.$nodeName; |
| 202 | 202 | } |
| 203 | - }else { |
|
| 203 | + } else { |
|
| 204 | 204 | $errorMessage = 'NO BUILDER FOUND FOR NODE-TYPE: '.$nodeName; |
| 205 | 205 | } |
| 206 | 206 | |
@@ -38,12 +38,12 @@ |
||
| 38 | 38 | * @param \PEIP\INF\Message\Message $message message to call the service with it�s content/payload |
| 39 | 39 | * @return mixed result of calling the registered service callable with message content/payload |
| 40 | 40 | */ |
| 41 | - protected function callService(\PEIP\INF\Message\Message $message){ |
|
| 41 | + protected function callService(\PEIP\INF\Message\Message $message) { |
|
| 42 | 42 | $res = NULL; |
| 43 | - if(is_callable($this->serviceCallable)){ |
|
| 43 | + if (is_callable($this->serviceCallable)) { |
|
| 44 | 44 | $res = call_user_func($this->serviceCallable, $message->getHeader($this->headerName)); |
| 45 | - }else{ |
|
| 46 | - if(is_object($this->serviceCallable) && method_exists($this->serviceCallable, 'handle')){ |
|
| 45 | + }else { |
|
| 46 | + if (is_object($this->serviceCallable) && method_exists($this->serviceCallable, 'handle')) { |
|
| 47 | 47 | $res = $this->serviceCallable->handle($message->getHeader($this->headerName)); |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -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; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $constructor = isset($config["constructor"]) ? (string)$config["constructor"] : ""; |
| 52 | 52 | if ($constructor != '' && Test::assertMethod($cls, $constructor)) {
|
| 53 | 53 | $service = call_user_func_array(array($cls, $constructor), $arguments); |
| 54 | - }else {
|
|
| 54 | + } else {
|
|
| 55 | 55 | $service = self::build($cls, $arguments); |
| 56 | 56 | } |
| 57 | 57 | } catch (\Exception $e) {
|
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | if ($entry->getName() == 'value') {
|
| 98 | 98 | if ($entry['key']) {
|
| 99 | 99 | $arg[(string)$entry['key']] = (string)$entry; |
| 100 | - }else {
|
|
| 100 | + } else {
|
|
| 101 | 101 | $arg[] = (string)$entry; |
| 102 | 102 | } |
| 103 | 103 | } elseif ($entry->getName() == 'service') {
|
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | public static function buildAndModify(array $config, $arguments, $defaultClass = "") {
|
| 130 | 130 | if ((isset($config["class"]) && "" != (string)$config["class"]) || $defaultClass !== "") {
|
| 131 | 131 | $service = ServiceFactory::doBuild($config, $arguments, $defaultClass); |
| 132 | - }else {
|
|
| 132 | + } else {
|
|
| 133 | 133 | throw new \RuntimeException('Could not create Service. no class or reference given.');
|
| 134 | 134 | } |
| 135 | 135 | if (isset($config["ref_property"])) {
|
@@ -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 | //} |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | public function setInputChannel(\PEIP\INF\Channel\Channel $inputChannel) { |
| 35 | 35 | if (isset($this->eventName)) { |
| 36 | 36 | $this->connectChannel($inputChannel); |
| 37 | - }else { |
|
| 37 | + } else { |
|
| 38 | 38 | $this->inputChannel = $inputChannel; |
| 39 | 39 | } |
| 40 | 40 | } |
@@ -58,9 +58,9 @@ |
||
| 58 | 58 | * @param mixed $subject subject to notify the listeners of |
| 59 | 59 | * @return \PEIP\INF\Handler\Handler listener that returned a boolean true value |
| 60 | 60 | */ |
| 61 | - protected static function doNotifyUntil(array $listeners, $subject){ |
|
| 62 | - foreach ($listeners as $listener){ |
|
| 63 | - if (self::doNotifyOne($listener, $subject)){ |
|
| 61 | + protected static function doNotifyUntil(array $listeners, $subject) { |
|
| 62 | + foreach ($listeners as $listener) { |
|
| 63 | + if (self::doNotifyOne($listener, $subject)) { |
|
| 64 | 64 | return $listener; |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | protected static function doNotifyOne($listener, $subject) { |
| 43 | 43 | if (is_callable($listener)) { |
| 44 | 44 | $res = call_user_func($listener, $subject); |
| 45 | - }else { |
|
| 45 | + } else { |
|
| 46 | 46 | $res = $listener->handle($subject); |
| 47 | 47 | } |
| 48 | 48 | return $res; |