@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function __construct($capacity = -1) |
33 | 33 | { |
34 | - $this->setCapacity((int) $capacity); |
|
34 | + $this->setCapacity((int)$capacity); |
|
35 | 35 | $this->queue = new SplQueue(); |
36 | 36 | } |
37 | 37 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | { |
71 | 71 | if ($this->capacity < 1 || $this->getMessageCount() <= $this->getCapacity()) { |
72 | 72 | $this->queue->enqueque($message); |
73 | - } else { |
|
73 | + }else { |
|
74 | 74 | throw new \Exception('Not implemented yet.'); |
75 | 75 | } |
76 | 76 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | //if(\PEIP\Util\Test::assertMessage($message)){ |
104 | 104 | if ($this->getOutputChannel()) { |
105 | 105 | $this->getOutputChannel()->send($message); |
106 | - } else { |
|
106 | + }else { |
|
107 | 107 | $this->doSend($message); |
108 | 108 | } |
109 | 109 | //} |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | public function command(\PEIP\INF\Message\Message $cmdMessage) |
196 | 196 | { |
197 | 197 | $this->doFireEvent(self::EVENT_PRE_COMMAND, [self::HEADER_MESSAGE => $cmdMessage]); |
198 | - $commandName = trim((string) $cmdMessage->getHeader('COMMAND')); |
|
198 | + $commandName = trim((string)$cmdMessage->getHeader('COMMAND')); |
|
199 | 199 | if ($commandName != '' && array_key_exists($commandName, $this->commands)) { |
200 | 200 | call_user_func($this->commands[$commandName], $cmdMessage->getContent()); |
201 | 201 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function __construct($content, $title) |
37 | 37 | { |
38 | - $this->setContent((string) $content); |
|
38 | + $this->setContent((string)$content); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function setTitle($title) |
47 | 47 | { |
48 | - $this->title = (string) $title; |
|
48 | + $this->title = (string)$title; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function getHeaders() |
84 | 84 | { |
85 | - return (array) $this->headers; |
|
85 | + return (array)$this->headers; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function getHeader($name) |
96 | 96 | { |
97 | - $name = (string) $name; |
|
97 | + $name = (string)$name; |
|
98 | 98 | |
99 | 99 | return isset($this->headers[$name]) ? $this->headers[$name] : null; |
100 | 100 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | { |
140 | 140 | $res = false; |
141 | 141 | try { |
142 | - $res = (string) $this->getContent(); |
|
142 | + $res = (string)$this->getContent(); |
|
143 | 143 | } catch (\Exception $e) { |
144 | 144 | try { |
145 | 145 | $res = get_class($this->getContent()); |
@@ -41,17 +41,17 @@ |
||
41 | 41 | if (is_array($this->callable)) { |
42 | 42 | list($class, $method) = $this->callable; |
43 | 43 | $static = !is_object($class); |
44 | - $class = is_object($class) ? get_class($class) : (string) $class; |
|
44 | + $class = is_object($class) ? get_class($class) : (string)$class; |
|
45 | 45 | $reflectionClass = new \ReflectionClass($class); |
46 | 46 | $reflectionFunc = $reflectionClass->getMethod($method); |
47 | 47 | if ($static && !$reflectionFunc->isStatic()) { |
48 | 48 | throw new \InvalidArgumentException('Argument 1 passed to CallableMessageHandler::__construct is not an Callable: Method "'.$method.'" of class '.$class.' is not static.'); |
49 | 49 | } |
50 | - } else { |
|
50 | + }else { |
|
51 | 51 | $reflectionFunc = new \ReflectionFunction($this->callable); |
52 | 52 | } |
53 | 53 | $this->requiredParameters = $reflectionFunc->getNumberOfRequiredParameters(); |
54 | - } else { |
|
54 | + }else { |
|
55 | 55 | throw new \InvalidArgumentException('Argument 1 passed to CallableMessageHandler::__construct is not a Callable'); |
56 | 56 | } |
57 | 57 | } |
@@ -28,12 +28,12 @@ |
||
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 | /** |
@@ -39,15 +39,15 @@ discard block |
||
39 | 39 | { |
40 | 40 | $array = []; |
41 | 41 | $array['type'] = $node['type'] |
42 | - ? (string) $node['type'] |
|
43 | - : (string) $node->getName(); |
|
44 | - $value = (string) $node; |
|
42 | + ? (string)$node['type'] |
|
43 | + : (string)$node->getName(); |
|
44 | + $value = (string)$node; |
|
45 | 45 | if ($value != '') { |
46 | 46 | $array['value'] = $value; |
47 | 47 | } |
48 | 48 | |
49 | 49 | foreach ($node->attributes() as $name => $value) { |
50 | - $array[$name] = (string) $value; |
|
50 | + $array[$name] = (string)$value; |
|
51 | 51 | } |
52 | 52 | foreach ($node->children() as $nr => $child) { |
53 | 53 | $name = $child->getName(); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | ], |
63 | 63 | ]; |
64 | 64 | } |
65 | - } else { |
|
65 | + }else { |
|
66 | 66 | $array[$name] = []; |
67 | 67 | } |
68 | 68 | $array[$name][] = $res; |
@@ -122,7 +122,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -71,7 +71,7 @@ |
||
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 | } |