Completed
Branch v1.ns (3cce68)
by Timo
03:38
created
src/Service/ServiceProvider.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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(
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Service/HeaderServiceActivator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@
 block discarded – undo
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
         }
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/Factory/ServiceFactory.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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"])) {
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.
src/ABS/Context/ContextPlugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/ABS/Handler/MessageHandler.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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)) {
Please login to merge, or discard this patch.