Completed
Branch v1.ns (3cce68)
by Timo
03:38
created
src/Dispatcher/ObjectEventDispatcher.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,10 +46,10 @@
 block discarded – undo
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
     }   
Please login to merge, or discard this patch.
src/INF/Dispatcher/ListDispatcher.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/INF/Message/MessageDispatcher.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Message/GenericMessage.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,8 +81,8 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -134,12 +134,10 @@
 block discarded – undo
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
         }     
Please login to merge, or discard this patch.
src/Message/CallableMessageHandler.php 1 patch
Braces   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }   
Please login to merge, or discard this patch.
src/Service/SplittingServiceActivator.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Pipe/Pipe.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
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
         //}
Please login to merge, or discard this patch.
src/ABS/Dispatcher/Dispatcher.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,9 +58,9 @@
 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
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
     protected function doSend(\PEIP\INF\Message\Message $message) {
55 55
         if ($this->capacity < 1 || $this->getMessageCount() <= $this->getCapacity()) {
56 56
             $this->queue->insert($message, $message->getHeader($this->priorityHeader));
57
-        }else {
57
+        } else {
58 58
             throw new \Exception('Not implemented yet.');
59 59
         }            
60 60
     }       
Please login to merge, or discard this patch.
src/ABS/Dispatcher/MapDispatcher.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
      * @param Callable|PEIP\INF\Handler\Handler $listener listener to connect
45 45
      * @return 
46 46
      */
47
-    public function connect($name, $listener){
47
+    public function connect($name, $listener) {
48 48
         Test::ensureHandler($listener);
49
-        if (!$this->hasListeners($name)){
49
+        if (!$this->hasListeners($name)) {
50 50
             $this->listeners[$name] = array();
51 51
         }
52 52
         $this->listeners[$name][] = $listener;
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
      * @param Callable|PEIP\INF\Handler\Handler $listener listener to connect
62 62
      * @return 
63 63
      */
64
-    public function disconnect($name, $listener){
65
-        if (!$this->hasListeners($name)){
64
+    public function disconnect($name, $listener) {
65
+        if (!$this->hasListeners($name)) {
66 66
             return false;
67 67
         }
68 68
         $res = false;
69
-        foreach ($this->listeners[$name] as $i => $callable){
70
-            if ($listener === $callable){
69
+        foreach ($this->listeners[$name] as $i => $callable) {
70
+            if ($listener === $callable) {
71 71
             unset($this->listeners[$name][$i]);
72 72
             $res = true;
73 73
             }
Please login to merge, or discard this patch.