Completed
Pull Request — v1.ns (#6)
by Timo
03:13
created
src/Factory/DedicatedFactory.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -47,6 +47,9 @@
 block discarded – undo
47 47
         return new DedicatedFactory(array($class, '__construct'), $parameters); 
48 48
     } 
49 49
 
50
+    /**
51
+     * @param string[] $callable
52
+     */
50 53
     public static function getfromCallable($callable, array $parameters = array()){
51 54
         return new DedicatedFactory($callable, $parameters); 
52 55
     } 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
      */
72 72
     public function setConstructor($method)
73 73
     {
74
-        $this->constructor = (string) $method;
74
+        $this->constructor = (string)$method;
75 75
 
76 76
         return $this;
77 77
     }
Please login to merge, or discard this patch.
src/Service/ServiceProvider.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -112,6 +112,9 @@
 block discarded – undo
112 112
         );
113 113
     }
114 114
 
115
+    /**
116
+     * @param string $key
117
+     */
115 118
     public function provideService($key){
116 119
         $this->doFireEvent(self::EVENT_BEFORE_PROVIDE_SERVICE, array(
117 120
             self::HEADER_KEY=>$key)
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
         if ($this->hasService($key)) {
124 124
             $service = $this->getService($key);
125
-        } else {
125
+        }else {
126 126
             $service = $this->createService($key);
127 127
         }
128 128
 
@@ -155,10 +155,10 @@  discard block
 block discarded – undo
155 155
                 ]);
156 156
 
157 157
                 return $node;
158
-            } else {
158
+            }else {
159 159
                 $errorMessage = 'COULD NOT BUILD NODE FOR KEY: '.$key;
160 160
             }
161
-        } else {
161
+        }else {
162 162
             $errorMessage = 'NO CONFIG FOR KEY: '.$key;
163 163
         }
164 164
         $this->doFireEvent(self::EVENT_CREATE_SERVICE_ERROR, [
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
      */
187 187
     protected function buildNode($config)
188 188
     {
189
-        $nodeName = (string) $config['type'];
189
+        $nodeName = (string)$config['type'];
190 190
 
191 191
         $this->doFireEvent(self::EVENT_BEFORE_BUILD_NODE, [
192 192
             self::HEADER_NODE_CONFIG => $config,
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
                 ]);
204 204
 
205 205
                 return $nodeInstance;
206
-            } else {
206
+            }else {
207 207
                 $errorMessage = 'BUILDER RETURNED NO OBJECT FOR NODE-TYPE: '.$nodeName;
208 208
             }
209
-        } else {
209
+        }else {
210 210
             $errorMessage = 'NO BUILDER FOUND FOR NODE-TYPE: '.$nodeName;
211 211
         }
212 212
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
     {
222 222
         $id = '';
223 223
         if (isset($config[$this->idAttribute])) {
224
-            $id = trim((string) ($config[$this->idAttribute]));
224
+            $id = trim((string)($config[$this->idAttribute]));
225 225
         }
226 226
 
227 227
         return $id;
Please login to merge, or discard this patch.
src/Plugins/BasePlugin.php 2 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
      *
214 214
      * @access protected
215 215
      * @param object $config configuration object to create arguments from.
216
-     * @return mixed build arguments
216
+     * @return \PEIP\INF\Channel\Channel[] build arguments
217 217
      */
218 218
     protected function getReplyHandlerArguments($config){
219 219
         $args = array(
@@ -259,6 +259,7 @@  discard block
 block discarded – undo
259 259
      * @access protected
260 260
      * @param string the configuration type ofthe channel (e.g.: 'reply', 'request')
261 261
      * @param object $config configuration object to return channel from.
262
+     * @param string $type
262 263
      * @return \PEIP\INF\Channel\Channel reply-channel
263 264
      */
264 265
     public function doGetChannel($type, $config){
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function doCreateChannel($config, $defaultChannelClass, array $additionalArguments = [])
69 69
     {
70
-        $id = (string) $config['id'];
70
+        $id = (string)$config['id'];
71 71
         if ($id != '') {
72 72
             array_unshift($additionalArguments, $id);
73 73
             $channel = $this->buildAndModify($config, $additionalArguments, $defaultChannelClass);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         ];
96 96
         $defaultClass = $defaultClass ? $defaultClass : '\PEIP\Gateway\SimpleMessagingGateway';
97 97
         $gateway = $this->buildAndModify($config, $args, $defaultClass);
98
-        $id = (string) $config['id'];
98
+        $id = (string)$config['id'];
99 99
         $this->gateways[$id] = $gateway;
100 100
 
101 101
         return $gateway;
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function createRouter($config, $defaultClass = false)
118 118
     {
119
-        $resolver = $config['channel_resolver'] ? (string) $config['channel_resolver'] : $this->channelRegistry;
119
+        $resolver = $config['channel_resolver'] ? (string)$config['channel_resolver'] : $this->channelRegistry;
120 120
 
121 121
         return $this->buildAndModify($config, [
122 122
             $resolver,
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
      */
212 212
     public function createServiceActivator($config, $defaultClass = false)
213 213
     {
214
-        $method = (string) $config['method'];
215
-        $service = $this->context->getServiceProvider()->provideService((string) $config['ref']);
214
+        $method = (string)$config['method'];
215
+        $service = $this->context->getServiceProvider()->provideService((string)$config['ref']);
216 216
         if ($method && $service) {
217 217
             $args = $this->getReplyHandlerArguments($config);
218 218
             array_unshift($args, [
@@ -287,6 +287,6 @@  discard block
 block discarded – undo
287 287
             ? $config[$type.'_channel']
288 288
             : $config['default_'.$type.'_channel'];
289 289
 
290
-        return $this->context->getServiceProvider()->provideService(trim((string) $channelName));
290
+        return $this->context->getServiceProvider()->provideService(trim((string)$channelName));
291 291
     }
292 292
 }
Please login to merge, or discard this patch.
src/Message/StringMessage.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,6 @@
 block discarded – undo
64 64
      * @static
65 65
      * @access public
66 66
      * @implements \PEIP\INF\Base\Buildable
67
-     * @param string $name the name of the header
68 67
      * @return boolean wether the header is set
69 68
      */
70 69
     public static function build(array $arguments = array()){
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@
 block discarded – undo
28 28
 
29 29
     public function __toString()
30 30
     {
31
-        return (string) $this->getContent();
31
+        return (string)$this->getContent();
32 32
     }
33 33
 
34 34
     public function getContent()
35 35
     {
36
-        return (string) parent::getContent();
36
+        return (string)parent::getContent();
37 37
     }
38 38
 
39 39
     /**
Please login to merge, or discard this patch.
src/Data/StoreCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Dispatcher/ObjectEventDispatcher.php 1 patch
Spacing   +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/Dispatcher/Dispatcher.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,6 @@
 block discarded – undo
64 64
     /**
65 65
      * Disconnects all listeners.
66 66
      *
67
-     * @param callable|PEIP\INF\Handler\Handler $listener
68 67
      *
69 68
      * @return void
70 69
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
      */
81 81
     public function hasListeners()
82 82
     {
83
-        return (bool) count($this->listeners);
83
+        return (bool)count($this->listeners);
84 84
     }
85 85
 
86 86
     /**
Please login to merge, or discard this patch.
src/Event/Event.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
      */
99 99
     public function setProcessed($processed)
100 100
     {
101
-        $this->processed = (bool) $processed;
101
+        $this->processed = (bool)$processed;
102 102
     }
103 103
 
104 104
     /**
Please login to merge, or discard this patch.
src/Util/Test.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 {
17 17
     public static function assertClassHasConstructor($className)
18 18
     {
19
-        return (bool) ReflectionPool::getInstance($className)->getConstructor();
19
+        return (bool)ReflectionPool::getInstance($className)->getConstructor();
20 20
     }
21 21
 
22 22
     public static function assertRequiredConstructorParameters($className, $parameters)
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 
31 31
     public static function assertInstanceOf($className, $object)
32 32
     {
33
-        return (bool) ReflectionPool::getInstance($className)
33
+        return (bool)ReflectionPool::getInstance($className)
34 34
             ->isInstance($object);
35 35
     }
36 36
 
37 37
     public static function assertClassOrInterfaceExists($className)
38 38
     {
39
-        return (bool) class_exists($className) || interface_exists($className);
39
+        return (bool)class_exists($className) || interface_exists($className);
40 40
     }
41 41
 
42 42
     public static function assertImplements($className, $interfaceName)
@@ -78,34 +78,34 @@  discard block
 block discarded – undo
78 78
 
79 79
     public static function assertArrayAccess($var)
80 80
     {
81
-        return (bool) is_array($var) || $var instanceof \ArrayAccess;
81
+        return (bool)is_array($var) || $var instanceof \ArrayAccess;
82 82
     }
83 83
 
84 84
     public static function assertHandler($var)
85 85
     {
86
-        return (bool) is_callable($var) || $var instanceof \PEIP\INF\Handler\Handler;
86
+        return (bool)is_callable($var) || $var instanceof \PEIP\INF\Handler\Handler;
87 87
     }
88 88
 
89 89
     public static function castType($var, $type)
90 90
     {
91 91
         switch ($type) {
92 92
             case 'string':
93
-                $var = (string) $var;
93
+                $var = (string)$var;
94 94
                 break;
95 95
             case 'integer':
96
-                $var = (int) $var;
96
+                $var = (int)$var;
97 97
                 break;
98 98
             case 'float':
99
-                $var = (float) $var;
99
+                $var = (float)$var;
100 100
                 break;
101 101
             case 'boolean':
102
-                $var = (bool) $var;
102
+                $var = (bool)$var;
103 103
                 break;
104 104
             case 'object':
105
-                $var = (object) $var;
105
+                $var = (object)$var;
106 106
                 break;
107 107
             case 'array':
108
-                $var = (array) $var;
108
+                $var = (array)$var;
109 109
                 break;
110 110
         }
111 111
 
Please login to merge, or discard this patch.