Completed
Push — v1.ns ( ab319d...410f3f )
by Timo
04:00
created
src/ABS/Router/Router.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         EVENT_PRE_RESOLVE = 'pre_resolve',
35 35
         EVENT_POST_RESOLVE = 'post_resolve',
36 36
         EVENT_ERR_RESOLVE = 'err_resolve',
37
-        HEADER_CHANNEL  = 'CHANNEL',
37
+        HEADER_CHANNEL = 'CHANNEL',
38 38
         HEADER_CHANNEL_NAME = 'CHANNEL_NAME',
39 39
         HEADER_CHANNEL_RESOLVER = 'HEADER_CHANNEL_RESOLVER';
40 40
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      * @param \PEIP\INF\Channel\Channel $inputChannel the input channel for the router 
49 49
      * @return 
50 50
      */
51
-    public function __construct(\PEIP\INF\Channel\Channel_Resolver $channelResolver, \PEIP\INF\Channel\Channel $inputChannel){
51
+    public function __construct(\PEIP\INF\Channel\Channel_Resolver $channelResolver, \PEIP\INF\Channel\Channel $inputChannel) {
52 52
         $this->channelResolver = $channelResolver;
53 53
         $this->setInputChannel($inputChannel);  
54 54
     }               
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      * @param \PEIP\INF\Channel\Channel_Resolver $channelResolver the channel resolver for the router
61 61
      * @return 
62 62
      */
63
-    public function setChannelResolver(\PEIP\INF\Channel\Channel_Resolver $channelResolver){
63
+    public function setChannelResolver(\PEIP\INF\Channel\Channel_Resolver $channelResolver) {
64 64
         $this->doFireEvent(self::EVENT_CHANNEL_RESOLVER_SET, array(self::HEADER_CHANNEL_RESOLVER=>$channelResolver));
65 65
         $this->channelResolver = $channelResolver;
66 66
         $this->doFireEvent(self::EVENT_CHANNEL_RESOLVER_SET, array(self::HEADER_CHANNEL_RESOLVER=>$channelResolver));
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
      * @param \PEIP\INF\Message\Message $message the message to reply with
74 74
      * @return 
75 75
      */
76
-    protected function doReply(\PEIP\INF\Message\Message $message){  
76
+    protected function doReply(\PEIP\INF\Message\Message $message) {  
77 77
         $channels = (array)$this->selectChannels($message);
78
-        foreach($channels as $channel){
78
+        foreach ($channels as $channel) {
79 79
             $this->setOutputChannel($this->resolveChannel($channel));
80 80
             $this->replyMessage($message); 
81 81
         }
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
      * @param mixed $channel channel-name or instance of \PEIP\INF\Channel\Channel 
91 91
      * @return 
92 92
      */
93
-    protected function resolveChannel($channel){
93
+    protected function resolveChannel($channel) {
94 94
         $this->doFireEvent(self::EVENT_PRE_RESOLVE, array(self::HEADER_CHANNEL=>$channel));
95
-        if(!($channel instanceof \PEIP\INF\Channel\Channel)){
95
+        if (!($channel instanceof \PEIP\INF\Channel\Channel)) {
96 96
             $channelName = $channel;
97 97
             $channel = $this->channelResolver->resolveChannelName($channelName);
98
-            if(!$channel){
98
+            if (!$channel) {
99 99
                 $this->doFireEvent(self::EVENT_ERR_RESOLVE, array(self::HEADER_CHANNEL_NAME=>$channelName));
100 100
                 throw new \RuntimeException('Could not resolve Channel : '.$channelName);
101 101
             }
Please login to merge, or discard this patch.
src/ABS/Transformer/Transformer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
      * @param \PEIP\INF\Channel\Channel $outputChannel the outputs-channel 
38 38
      * @return 
39 39
      */
40
-    public function __construct(\PEIP\INF\Channel\Channel $inputChannel, \PEIP\INF\Channel\Channel $outputChannel = NULL){
40
+    public function __construct(\PEIP\INF\Channel\Channel $inputChannel, \PEIP\INF\Channel\Channel $outputChannel = NULL) {
41 41
         $this->setInputChannel($inputChannel);
42
-        if(is_object($outputChannel)){
42
+        if (is_object($outputChannel)) {
43 43
             $this->setOutputChannel($outputChannel);    
44 44
         }   
45 45
     }           
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      * @param \PEIP\INF\Message\Message $message message to transform content 
52 52
      * @return 
53 53
      */
54
-    public function doReply(\PEIP\INF\Message\Message $message){     
54
+    public function doReply(\PEIP\INF\Message\Message $message) {     
55 55
         $this->replyMessage($this->transform($message));
56 56
     }
57 57
   
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      * @param \PEIP\INF\Message\Message $message 
63 63
      * @return mixed result of transforming the message 
64 64
      */
65
-    public function transform(\PEIP\INF\Message\Message $message){
65
+    public function transform(\PEIP\INF\Message\Message $message) {
66 66
         return $this->doTransform($message);
67 67
     }
68 68
 
Please login to merge, or discard this patch.
src/ABS/Transformer/ContentTransformer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      * @param \PEIP\INF\Message\Message $message 
35 35
      * @return mixed result of transforming the message payload/content 
36 36
      */
37
-    protected function doTransform(\PEIP\INF\Message\Message $message){
37
+    protected function doTransform(\PEIP\INF\Message\Message $message) {
38 38
         return $this->transformContent($message->getContent());    
39 39
     }
40 40
 
Please login to merge, or discard this patch.
src/ABS/Command/Command.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      * @access public
41 41
      * @return 
42 42
      */
43
-    public function __invoke(){
43
+    public function __invoke() {
44 44
         return $this->execute();
45 45
     }
46 46
    
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      * @access public
52 52
      * @return 
53 53
      */
54
-    public function execute(){
54
+    public function execute() {
55 55
         return call_user_func_array($this->callable, $this->getParameters());
56 56
     }   
57 57
         
Please login to merge, or discard this patch.
src/ABS/Service/ServiceActivator.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
      * @param \PEIP\INF\Message\Message $message message to handle/reply for
39 39
      * @return 
40 40
      */
41
-    public function doReply(\PEIP\INF\Message\Message $message){
41
+    public function doReply(\PEIP\INF\Message\Message $message) {
42 42
         $res = $this->callService($message);
43 43
         $out = (bool)$message->hasHeader('REPLY_CHANNEL') 
44 44
             ? $message->getHeader('REPLY_CHANNEL') 
45 45
             : $this->outputChannel;    
46
-        if($out){
46
+        if ($out) {
47 47
             $this->replyMessage($res, $res);    
48 48
         }
49 49
     }  
@@ -56,12 +56,12 @@  discard block
 block discarded – undo
56 56
      * @param \PEIP\INF\Message\Message $message message to call the service with it�s content/payload
57 57
      * @return mixed result of calling the registered service callable with message content/payload
58 58
      */
59
-    protected function callService(\PEIP\INF\Message\Message $message){
59
+    protected function callService(\PEIP\INF\Message\Message $message) {
60 60
         $res = NULL;
61
-        if(is_callable($this->serviceCallable)){
61
+        if (is_callable($this->serviceCallable)) {
62 62
             $res = call_user_func($this->serviceCallable, $message->getContent());
63
-        }else{
64
-            if(is_object($this->serviceCallable) && method_exists($this->serviceCallable, 'handle')){
63
+        }else {
64
+            if (is_object($this->serviceCallable) && method_exists($this->serviceCallable, 'handle')) {
65 65
                 $res = $this->serviceCallable->handle($message->getContent());
66 66
             }
67 67
         }    
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
src/ABS/Splitter/MessageSplitter.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
      * @param \PEIP\INF\Channel\Channel $outputChannel the outputs-channel 
36 36
      * @return 
37 37
      */
38
-    public function __construct(\PEIP\INF\Channel\Channel $inputChannel, \PEIP\INF\Channel\Channel $outputChannel = NULL){
38
+    public function __construct(\PEIP\INF\Channel\Channel $inputChannel, \PEIP\INF\Channel\Channel $outputChannel = NULL) {
39 39
         $this->setInputChannel($inputChannel);
40
-        if(is_object($outputChannel)){
40
+        if (is_object($outputChannel)) {
41 41
             $this->setOutputChannel($outputChannel);    
42 42
         }   
43 43
     }           
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
      * @param \PEIP\INF\Message\Message $message message to split 
50 50
      * @return 
51 51
      */
52
-    public function doReply(\PEIP\INF\Message\Message $message){     
52
+    public function doReply(\PEIP\INF\Message\Message $message) {     
53 53
         $res = $this->split($message);      
54
-        if(is_array($res)){
55
-            foreach($res as $msg){ 
54
+        if (is_array($res)) {
55
+            foreach ($res as $msg) { 
56 56
                 $this->replyMessage($msg);
57 57
             }
58
-        }else{
58
+        }else {
59 59
             $this->replyMessage($res);
60 60
         }
61 61
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
             foreach($res as $msg){ 
56 56
                 $this->replyMessage($msg);
57 57
             }
58
-        }else{
58
+        } else{
59 59
             $this->replyMessage($res);
60 60
         }
61 61
     }
Please login to merge, or discard this patch.
src/ABS/Dispatcher/Dispatcher.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@
 block discarded – undo
60 60
      */     
61 61
     protected static function doNotifyUntil(array $listeners, $subject){
62 62
         foreach ($listeners as $listener){
63
-          if (self::doNotifyOne($listener, $subject)){
63
+            if (self::doNotifyOne($listener, $subject)){
64 64
             return $listener;
65
-          }
65
+            }
66 66
         }
67 67
         return NULL;
68 68
     } 
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,16 +33,16 @@  discard block
 block discarded – undo
33 33
      * @param mixed $subject subject to notify the listeners of 
34 34
      * @return void
35 35
      */ 
36
-    protected static function doNotify(array $listeners, $subject){
37
-        foreach($listeners as $listener){
36
+    protected static function doNotify(array $listeners, $subject) {
37
+        foreach ($listeners as $listener) {
38 38
             self::doNotifyOne($listener, $subject);
39 39
         }   
40 40
     }  
41 41
 
42
-    protected static function doNotifyOne($listener, $subject){
43
-        if(is_callable($listener)){
42
+    protected static function doNotifyOne($listener, $subject) {
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;
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Channel/ChannelAdapter.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,22 +9,22 @@
 block discarded – undo
9 9
     protected $channel;
10 10
     protected $handler;
11 11
 
12
-    public function __construct(\PEIP\ABS\Handler\MessageHandler $handler,  $channel){
12
+    public function __construct(\PEIP\ABS\Handler\MessageHandler $handler, $channel) {
13 13
         $this->channel = $channel;
14 14
         $this->handler = $handler;
15 15
     }
16 16
 
17
-    protected function getMessage($object){
18
-        if($this->channel instanceof \PEIP\INF\Channel\SubscribableChannel){
17
+    protected function getMessage($object) {
18
+        if ($this->channel instanceof \PEIP\INF\Channel\SubscribableChannel) {
19 19
             return $object; 
20
-        }else{
20
+        }else {
21 21
             return $object->getContent()->receive();
22 22
         }
23 23
     }
24 24
 
25
-    public function handle($object){
25
+    public function handle($object) {
26 26
         $message = $this->getMessage($object);
27
-                if(!is_object($message)){ 
27
+                if (!is_object($message)) { 
28 28
                     throw new \Exception('Could not get Message from Channel');
29 29
                 }               
30 30
                 $this->handler->handle($message);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
     protected function getMessage($object){
18 18
         if($this->channel instanceof \PEIP\INF\Channel\SubscribableChannel){
19 19
             return $object; 
20
-        }else{
20
+        } else{
21 21
             return $object->getContent()->receive();
22 22
         }
23 23
     }
Please login to merge, or discard this patch.
src/Channel/ChannelRegistry.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      * @param $name 
34 34
      * @return 
35 35
      */
36
-    public static function getInstance(){
36
+    public static function getInstance() {
37 37
         return self::$instance ? self::$instance : self::$instance = new ChannelRegistry;
38 38
     }
39 39
     
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      * @param $channel 
44 44
      * @return 
45 45
      */
46
-    public function register($channel){
46
+    public function register($channel) {
47 47
         $this->channels[$channel->getName()] = $channel;
48 48
     }
49 49
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      * @param $name 
56 56
      * @return 
57 57
      */
58
-    public function get($name){
58
+    public function get($name) {
59 59
         return $this->channels[$name];
60 60
     }
61 61
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @param $channelName 
66 66
      * @return 
67 67
      */
68
-    public function resolveChannelName($channelName){
68
+    public function resolveChannelName($channelName) {
69 69
         return $this->get($channelName);
70 70
     }   
71 71
     
Please login to merge, or discard this patch.