@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @param object $config configuration object for the pollable channel. |
43 | 43 | * @return \PEIP\INF\Channel\Channel the created pollable channel instance |
44 | 44 | */ |
45 | - public function createChannel($config){ |
|
45 | + public function createChannel($config) { |
|
46 | 46 | return $this->doCreateChannel($config, '\PEIP\Channel\PollableChannel'); |
47 | 47 | } |
48 | 48 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @param object $config configuration object for the subscribable channel. |
55 | 55 | * @return \PEIP\INF\Channel\Channel the created subscribable channel instance |
56 | 56 | */ |
57 | - public function createSubscribableChannel($config){ |
|
57 | + public function createSubscribableChannel($config) { |
|
58 | 58 | return $this->doCreateChannel($config, '\PEIP\Channel\PublishSubscribeChannel'); |
59 | 59 | } |
60 | 60 | |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | * @param $additionalArguments additional arguments for the channel constructor (without first arg = id) |
68 | 68 | * @return \PEIP\INF\Channel\Channel the created channel instance |
69 | 69 | */ |
70 | - public function doCreateChannel($config, $defaultChannelClass, array $additionalArguments = array()){ |
|
70 | + public function doCreateChannel($config, $defaultChannelClass, array $additionalArguments = array()) { |
|
71 | 71 | $id = (string)$config['id']; |
72 | - if($id != ''){ |
|
72 | + if ($id != '') { |
|
73 | 73 | array_unshift($additionalArguments, $id); |
74 | 74 | $channel = $this->buildAndModify($config, $additionalArguments, $defaultChannelClass); |
75 | 75 | //$this->channelRegistry->register($channel); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @param string $defaultClass the class to use if none is set in config. |
88 | 88 | * @return object the gateway instance |
89 | 89 | */ |
90 | - public function createGateway($config, $defaultClass = false){ |
|
90 | + public function createGateway($config, $defaultClass = false) { |
|
91 | 91 | $args = array( |
92 | 92 | $this->getRequestChannel($config), |
93 | 93 | $this->getReplyChannel($config) |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @param string $defaultClass the class to use if none is set in config. |
112 | 112 | * @return object the router instance |
113 | 113 | */ |
114 | - public function createRouter($config, $defaultClass = false){ |
|
114 | + public function createRouter($config, $defaultClass = false) { |
|
115 | 115 | $resolver = $config['channel_resolver'] ? (string)$config['channel_resolver'] : $this->channelRegistry; |
116 | 116 | return $this->buildAndModify($config, array( |
117 | 117 | $resolver, |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * @param object $config configuration object for the splitter. |
129 | 129 | * @return object the splitter instance |
130 | 130 | */ |
131 | - public function createSplitter($config){ |
|
131 | + public function createSplitter($config) { |
|
132 | 132 | return $this->createReplyMessageHandler($config); |
133 | 133 | } |
134 | 134 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | * @param object $config configuration object for the transformer. |
142 | 142 | * @return object the transformer instance |
143 | 143 | */ |
144 | - public function createTransformer($config){ |
|
144 | + public function createTransformer($config) { |
|
145 | 145 | return $this->createReplyMessageHandler($config); |
146 | 146 | } |
147 | 147 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * @param object $config configuration object for the aggregator. |
155 | 155 | * @return object the aggregator instance |
156 | 156 | */ |
157 | - public function createAggregator($config){ |
|
157 | + public function createAggregator($config) { |
|
158 | 158 | return $this->createReplyMessageHandler($config); |
159 | 159 | } |
160 | 160 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * @param object $config configuration object for the wiretap. |
168 | 168 | * @return object the wiretap instance |
169 | 169 | */ |
170 | - public function createWiretap($config){ |
|
170 | + public function createWiretap($config) { |
|
171 | 171 | return $this->createReplyMessageHandler($config, '\PEIP\Listener\Wiretap'); |
172 | 172 | } |
173 | 173 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * @param string $defaultClass the class to use if none is set in config. |
181 | 181 | * @return object the reply-message-handler instance |
182 | 182 | */ |
183 | - public function createReplyMessageHandler($config, $defaultClass = false){ |
|
183 | + public function createReplyMessageHandler($config, $defaultClass = false) { |
|
184 | 184 | return $this->buildAndModify($config, $this->getReplyHandlerArguments($config), $defaultClass); |
185 | 185 | } |
186 | 186 | |
@@ -193,12 +193,12 @@ discard block |
||
193 | 193 | * @param string $defaultClass the class to use if none is set in config. |
194 | 194 | * @return object the service-activator instance |
195 | 195 | */ |
196 | - public function createServiceActivator($config, $defaultClass = false){ |
|
196 | + public function createServiceActivator($config, $defaultClass = false) { |
|
197 | 197 | $method = (string)$config['method']; |
198 | 198 | $service = $this->context->getServiceProvider()->provideService((string)$config['ref']); |
199 | - if($method && $service){ |
|
199 | + if ($method && $service) { |
|
200 | 200 | $args = $this->getReplyHandlerArguments($config); |
201 | - array_unshift($args,array( |
|
201 | + array_unshift($args, array( |
|
202 | 202 | $service, |
203 | 203 | $method |
204 | 204 | )); |
@@ -215,12 +215,12 @@ discard block |
||
215 | 215 | * @param object $config configuration object to create arguments from. |
216 | 216 | * @return mixed build arguments |
217 | 217 | */ |
218 | - protected function getReplyHandlerArguments($config){ |
|
218 | + protected function getReplyHandlerArguments($config) { |
|
219 | 219 | $args = array( |
220 | 220 | $this->doGetChannel('input', $config), |
221 | 221 | $this->doGetChannel('output', $config) |
222 | 222 | ); |
223 | - if($args[0] == NULL){ |
|
223 | + if ($args[0] == NULL) { |
|
224 | 224 | throw new \RuntimeException('Could not receive input channel.'); |
225 | 225 | } |
226 | 226 | return $args; |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | * @param object $config configuration object to return request-channel from. |
236 | 236 | * @return \PEIP\INF\Channel\Channel request-channel |
237 | 237 | */ |
238 | - protected function getRequestChannel($config){ |
|
238 | + protected function getRequestChannel($config) { |
|
239 | 239 | return $this->doGetChannel('request', $config); |
240 | 240 | } |
241 | 241 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | * @param object $config configuration object to return reply-channel from. |
249 | 249 | * @return \PEIP\INF\Channel\Channel reply-channel |
250 | 250 | */ |
251 | - protected function getReplyChannel($config){ |
|
251 | + protected function getReplyChannel($config) { |
|
252 | 252 | return $this->doGetChannel('reply', $config); |
253 | 253 | } |
254 | 254 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | * @param object $config configuration object to return channel from. |
262 | 262 | * @return \PEIP\INF\Channel\Channel reply-channel |
263 | 263 | */ |
264 | - public function doGetChannel($type, $config){ |
|
264 | + public function doGetChannel($type, $config) { |
|
265 | 265 | $channelName = isset($config[$type."_channel"]) |
266 | 266 | ? $config[$type."_channel"] |
267 | 267 | : $config["default_".$type."_channel"]; |