@@ -60,7 +60,7 @@ |
||
| 60 | 60 | $res = NULL; |
| 61 | 61 | if (is_callable($this->serviceCallable)) { |
| 62 | 62 | $res = call_user_func($this->serviceCallable, $message->getContent()); |
| 63 | - }else { |
|
| 63 | + } else { |
|
| 64 | 64 | if (is_object($this->serviceCallable) && method_exists($this->serviceCallable, 'handle')) { |
| 65 | 65 | $res = $this->serviceCallable->handle($message->getContent()); |
| 66 | 66 | } |
@@ -48,11 +48,11 @@ |
||
| 48 | 48 | $message = NULL; |
| 49 | 49 | if ($timeout == 0) { |
| 50 | 50 | $message = $this->getMessage(); |
| 51 | - }elseif ($timeout < 0) { |
|
| 51 | + } elseif ($timeout < 0) { |
|
| 52 | 52 | while (!$message = $this->getMessage()) { |
| 53 | 53 | |
| 54 | 54 | } |
| 55 | - }else { |
|
| 55 | + } else { |
|
| 56 | 56 | $time = time() + $timeout; |
| 57 | 57 | while (($time > time()) && !$message = $this->getMessage()) { |
| 58 | 58 | |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | * @param string $defaultClass class to create instance for if none is set in config |
| 60 | 60 | * @return object build and modified srvice instance |
| 61 | 61 | */ |
| 62 | - public function buildAndModify($config, $arguments, $defaultClass = false){ |
|
| 62 | + public function buildAndModify($config, $arguments, $defaultClass = false) { |
|
| 63 | 63 | return ServiceFactory::buildAndModify($config, $arguments, $defaultClass); |
| 64 | 64 | } |
| 65 | 65 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @param object $message the message to handle |
| 43 | 43 | * @return |
| 44 | 44 | */ |
| 45 | - public function handle($message){ |
|
| 45 | + public function handle($message) { |
|
| 46 | 46 | $this->doHandle($this->getMessageFromObject($message)); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -73,24 +73,24 @@ discard block |
||
| 73 | 73 | * @param \PEIP\INF\Channel\Channel $inputChannel the input-channel to connect the handler to |
| 74 | 74 | * @return |
| 75 | 75 | */ |
| 76 | - protected function doSetInputChannel(\PEIP\INF\Channel\Channel $inputChannel){ |
|
| 76 | + protected function doSetInputChannel(\PEIP\INF\Channel\Channel $inputChannel) { |
|
| 77 | 77 | $this->inputChannel = $inputChannel; |
| 78 | - if($this->inputChannel instanceof \PEIP\INF\Channel\SubscribableChannel){ |
|
| 78 | + if ($this->inputChannel instanceof \PEIP\INF\Channel\SubscribableChannel) { |
|
| 79 | 79 | $this->inputChannel->subscribe($this); |
| 80 | - } else{ |
|
| 80 | + }else { |
|
| 81 | 81 | $this->unwrapEvents = true; |
| 82 | 82 | $this->inputChannel->connect('postSend', $this); |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - protected function getMessageFromObject($object){ |
|
| 86 | + protected function getMessageFromObject($object) { |
|
| 87 | 87 | $content = $object->getContent(); |
| 88 | - if($this->unwrapEvents |
|
| 88 | + if ($this->unwrapEvents |
|
| 89 | 89 | && $object instanceof \PEIP\INF\Event\Event |
| 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)) { |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | $store = $this->factory->build(); |
| 51 | 51 | if ($store instanceof \PEIP\INF\Data\ParameterHolder) { |
| 52 | 52 | $this->stores[$namespace] = $store; |
| 53 | - }else { |
|
| 53 | + } else { |
|
| 54 | 54 | throw new \Exception('Could not build Instance of \PEIP\INF\Data\ParameterHolder from factory.'); |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | $store = $this->factory->build(); |
| 55 | 55 | if ($store instanceof \PEIP\INF\Data\Store) { |
| 56 | 56 | $this->setPrivateValue($namespace, $store); |
| 57 | - }else { |
|
| 57 | + } else { |
|
| 58 | 58 | throw new \Exception('Could not build Instance of \PEIP\INF\Data\Store from factory.'); |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -30,8 +30,7 @@ discard block |
||
| 30 | 30 | throw new \Exception('loading XML failed'); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - } |
|
| 34 | - catch (\Exception $e) { |
|
| 33 | + } catch (\Exception $e) { |
|
| 35 | 34 | return false; |
| 36 | 35 | } |
| 37 | 36 | |
@@ -65,7 +64,7 @@ discard block |
||
| 65 | 64 | ) |
| 66 | 65 | ); |
| 67 | 66 | } |
| 68 | - }else { |
|
| 67 | + } else { |
|
| 69 | 68 | $array[$name] = array(); |
| 70 | 69 | } |
| 71 | 70 | $array[$name][] = $res; |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | protected function doSend(\PEIP\INF\Message\Message $message) { |
| 80 | 80 | if ($this->capacity < 1 || $this->getMessageCount() <= $this->getCapacity()) { |
| 81 | 81 | $this->queue->enqueque($message); |
| 82 | - }else { |
|
| 82 | + } else { |
|
| 83 | 83 | throw new \Exception('Not implemented yet.'); |
| 84 | 84 | } |
| 85 | 85 | } |
@@ -60,11 +60,11 @@ |
||
| 60 | 60 | $message = NULL; |
| 61 | 61 | if ($timeout == 0) { |
| 62 | 62 | $message = $this->getMessage(); |
| 63 | - }elseif ($timeout < 0) { |
|
| 63 | + } elseif ($timeout < 0) { |
|
| 64 | 64 | while (!$message = $this->getMessage()) { |
| 65 | 65 | |
| 66 | 66 | } |
| 67 | - }else { |
|
| 67 | + } else { |
|
| 68 | 68 | $time = time() + $timeout; |
| 69 | 69 | while (($time > time()) && !$message = $this->getMessage()) { |
| 70 | 70 | |