@@ -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()); |
@@ -104,7 +104,7 @@ |
||
104 | 104 | $listners = $this->doGetListeners(); |
105 | 105 | if (!$this->hadListeners($name, $object)) { |
106 | 106 | $res = false; |
107 | - } else { |
|
107 | + }else { |
|
108 | 108 | $listners = $this->doGetListeners(); |
109 | 109 | $res = (boolean)count($listners[$object][$name]); |
110 | 110 | } |
@@ -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 | } |
@@ -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; |
@@ -104,7 +104,7 @@ |
||
104 | 104 | $listners = $this->doGetListeners(); |
105 | 105 | if (!$this->hadListeners($name, $object)) { |
106 | 106 | $res = false; |
107 | - } else { |
|
107 | + }else { |
|
108 | 108 | $listners = $this->doGetListeners(); |
109 | 109 | $res = (boolean)count($listners[$object][$name]); |
110 | 110 | } |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public static function doBuild($config, $arguments, $defaultClass = false) |
53 | 53 | { |
54 | - $cls = isset($config['class']) ? trim((string) $config['class']) : (string) $defaultClass; |
|
54 | + $cls = isset($config['class']) ? trim((string)$config['class']) : (string)$defaultClass; |
|
55 | 55 | if ($cls != '') { |
56 | 56 | try { |
57 | - $constructor = isset($config['constructor']) ? (string) $config['constructor'] : ''; |
|
57 | + $constructor = isset($config['constructor']) ? (string)$config['constructor'] : ''; |
|
58 | 58 | if ($constructor != '' && Test::assertMethod($cls, $constructor)) { |
59 | 59 | $service = call_user_func_array([$cls, $constructor], $arguments); |
60 | - } else { |
|
60 | + }else { |
|
61 | 61 | $service = self::build($cls, $arguments); |
62 | 62 | } |
63 | 63 | } catch (\Exception $e) { |
@@ -95,18 +95,18 @@ discard block |
||
95 | 95 | */ |
96 | 96 | protected static function buildArg($config) |
97 | 97 | { |
98 | - if (trim((string) $config['value']) != '') { |
|
99 | - $arg = (string) $config['value']; |
|
98 | + if (trim((string)$config['value']) != '') { |
|
99 | + $arg = (string)$config['value']; |
|
100 | 100 | } elseif ($config->getName() == 'value') { |
101 | - $arg = (string) $config; |
|
101 | + $arg = (string)$config; |
|
102 | 102 | } elseif ($config->getName() == 'list') { |
103 | 103 | $arg = []; |
104 | 104 | foreach ($config->children() as $entry) { |
105 | 105 | if ($entry->getName() == 'value') { |
106 | 106 | if ($entry['key']) { |
107 | - $arg[(string) $entry['key']] = (string) $entry; |
|
108 | - } else { |
|
109 | - $arg[] = (string) $entry; |
|
107 | + $arg[(string)$entry['key']] = (string)$entry; |
|
108 | + }else { |
|
109 | + $arg[] = (string)$entry; |
|
110 | 110 | } |
111 | 111 | } elseif ($entry->getName() == 'service') { |
112 | 112 | $arg[] = $this->provideService($entry); |
@@ -138,13 +138,13 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public static function buildAndModify(array $config, $arguments, $defaultClass = '') |
140 | 140 | { |
141 | - if ((isset($config['class']) && '' != (string) $config['class']) || $defaultClass !== '') { |
|
141 | + if ((isset($config['class']) && '' != (string)$config['class']) || $defaultClass !== '') { |
|
142 | 142 | $service = self::doBuild($config, $arguments, $defaultClass); |
143 | - } else { |
|
143 | + }else { |
|
144 | 144 | throw new \RuntimeException('Could not create Service. no class or reference given.'); |
145 | 145 | } |
146 | 146 | if (isset($config['ref_property'])) { |
147 | - $service = $service->{(string) $config['ref_property']}; |
|
147 | + $service = $service->{(string)$config['ref_property']}; |
|
148 | 148 | } elseif (isset($config['ref_method'])) { |
149 | 149 | $args = []; |
150 | 150 | if (isset($config['argument'])) { |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $args[] = self::buildArg($arg); |
153 | 153 | } |
154 | 154 | } |
155 | - $service = call_user_func_array([$service, (string) $config['ref_method']], $args); |
|
155 | + $service = call_user_func_array([$service, (string)$config['ref_method']], $args); |
|
156 | 156 | } |
157 | 157 | if (!is_object($service)) { |
158 | 158 | throw new \RuntimeException('Could not create Service.'); |
@@ -195,13 +195,13 @@ discard block |
||
195 | 195 | // call instance methods |
196 | 196 | if (isset($config->action)) { |
197 | 197 | foreach ($config->action as $action) { |
198 | - $method = (string) $action['method'] != '' ? (string) $action['method'] : null; |
|
198 | + $method = (string)$action['method'] != '' ? (string)$action['method'] : null; |
|
199 | 199 | if ($method && self::hasPublicProperty($service, 'Method', $method)) { |
200 | 200 | $args = []; |
201 | 201 | foreach ($action->children() as $argument) { |
202 | 202 | $args[] = self::buildArg($argument); |
203 | 203 | } |
204 | - call_user_func_array([$service, (string) $action['method']], $args); |
|
204 | + call_user_func_array([$service, (string)$action['method']], $args); |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | if ($service instanceof \PEIP\INF\Event\Connectable) { |
210 | 210 | if (isset($config->listener)) { |
211 | 211 | foreach ($config->listener as $listenerConf) { |
212 | - $event = (string) $listenerConf['event']; |
|
212 | + $event = (string)$listenerConf['event']; |
|
213 | 213 | $listener = $this->provideService($listenerConf); |
214 | 214 | $service->connect($event, $listener); |
215 | 215 | } |
@@ -104,7 +104,7 @@ |
||
104 | 104 | $listners = $this->doGetListeners(); |
105 | 105 | if (!$this->hadListeners($name, $object)) { |
106 | 106 | $res = false; |
107 | - } else { |
|
107 | + }else { |
|
108 | 108 | $listners = $this->doGetListeners(); |
109 | 109 | $res = (boolean)count($listners[$object][$name]); |
110 | 110 | } |