@@ -34,7 +34,7 @@ |
||
34 | 34 | * @param $params |
35 | 35 | * @return |
36 | 36 | */ |
37 | - public function __construct($callable, array $params = array()){ |
|
37 | + public function __construct($callable, array $params = array()) { |
|
38 | 38 | $this->callable = $callable; |
39 | 39 | $this->setParameters($params); |
40 | 40 | } |
@@ -33,12 +33,12 @@ |
||
33 | 33 | * @param $outputChannel |
34 | 34 | * @return |
35 | 35 | */ |
36 | - public function __construct($serviceCallable, \PEIP\INF\Channel\Channel $inputChannel = NULL, \PEIP\INF\Channel\Channel $outputChannel = NULL){ |
|
36 | + public function __construct($serviceCallable, \PEIP\INF\Channel\Channel $inputChannel = NULL, \PEIP\INF\Channel\Channel $outputChannel = NULL) { |
|
37 | 37 | $this->serviceCallable = $serviceCallable; |
38 | - if(is_object($inputChannel)){ |
|
38 | + if (is_object($inputChannel)) { |
|
39 | 39 | $this->setInputChannel($inputChannel); |
40 | 40 | } |
41 | - if(is_object($outputChannel)){ |
|
41 | + if (is_object($outputChannel)) { |
|
42 | 42 | $this->setOutputChannel($outputChannel); |
43 | 43 | } |
44 | 44 | } |
@@ -33,10 +33,10 @@ |
||
33 | 33 | * @param \PEIP\INF\Message\Message $message message to call the service with it�s content/payload |
34 | 34 | * @return mixed result of calling the registered service callable with message content/payload |
35 | 35 | */ |
36 | - public function callService(\PEIP\INF\Message\Message $message){ |
|
37 | - if(is_callable($this->serviceCallable)){ |
|
36 | + public function callService(\PEIP\INF\Message\Message $message) { |
|
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; |
@@ -36,7 +36,7 @@ |
||
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; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | use \PEIP\Data\InternalStoreAbstract; |
26 | 26 | use PEIP\Factory\DedicatedFactory; |
27 | 27 | |
28 | -class ServiceContainerBuilder extends \PEIP\Data\InternalStoreAbstract{ |
|
28 | +class ServiceContainerBuilder extends \PEIP\Data\InternalStoreAbstract { |
|
29 | 29 | |
30 | 30 | |
31 | 31 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @param $factory |
36 | 36 | * @return |
37 | 37 | */ |
38 | - public function setFactory($key, DedicatedFactory $factory){ |
|
38 | + public function setFactory($key, DedicatedFactory $factory) { |
|
39 | 39 | $this->setInternalValue($key, $factory); |
40 | 40 | } |
41 | 41 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param $key |
46 | 46 | * @return |
47 | 47 | */ |
48 | - public function getFactory($key){ |
|
48 | + public function getFactory($key) { |
|
49 | 49 | $this->getInternalValue($key); |
50 | 50 | } |
51 | 51 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @param $key |
56 | 56 | * @return |
57 | 57 | */ |
58 | - public function hasFactory($key){ |
|
58 | + public function hasFactory($key) { |
|
59 | 59 | $this->hasInternalValue($key); |
60 | 60 | } |
61 | 61 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @param $key |
66 | 66 | * @return |
67 | 67 | */ |
68 | - public function deleteFactory($key){ |
|
68 | + public function deleteFactory($key) { |
|
69 | 69 | $this->deleteInternalValue($key); |
70 | 70 | } |
71 | 71 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @param $key |
76 | 76 | * @return |
77 | 77 | */ |
78 | - public function getService($key){ |
|
78 | + public function getService($key) { |
|
79 | 79 | return isset($this->services[$key]) ? $this->services[$key] : $this->services[$key] = $this->getFactory($key)->build(); |
80 | 80 | } |
81 | 81 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @param $key |
87 | 87 | * @return |
88 | 88 | */ |
89 | - public function buildService($key){ |
|
89 | + public function buildService($key) { |
|
90 | 90 | return $this->getFactory($key)->build(); |
91 | 91 | } |
92 | 92 |
@@ -32,11 +32,11 @@ |
||
32 | 32 | protected $services = array(); |
33 | 33 | |
34 | 34 | |
35 | - /** |
|
36 | - * Constructor. |
|
37 | - * |
|
38 | - * @param array $parameters An array of parameters |
|
39 | - */ |
|
35 | + /** |
|
36 | + * Constructor. |
|
37 | + * |
|
38 | + * @param array $parameters An array of parameters |
|
39 | + */ |
|
40 | 40 | |
41 | 41 | |
42 | 42 | /** |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | class ServiceContainer |
28 | 28 | extends \PEIP\ABS\Base\Connectable |
29 | 29 | implements |
30 | - \PEIP\INF\Service\ServiceContainer{ |
|
30 | + \PEIP\INF\Service\ServiceContainer { |
|
31 | 31 | |
32 | 32 | protected $services = array(); |
33 | 33 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param $service |
46 | 46 | * @return |
47 | 47 | */ |
48 | - public function setService($key, $service){ |
|
48 | + public function setService($key, $service) { |
|
49 | 49 | $this->services[$key] = $service; |
50 | 50 | } |
51 | 51 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @param $key |
56 | 56 | * @return |
57 | 57 | */ |
58 | - public function getService($key){ |
|
58 | + public function getService($key) { |
|
59 | 59 | return $this->services[$key]; |
60 | 60 | } |
61 | 61 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @param $key |
66 | 66 | * @return |
67 | 67 | */ |
68 | - public function hasService($key){ |
|
68 | + public function hasService($key) { |
|
69 | 69 | return array_key_exists($key, $this->services); |
70 | 70 | } |
71 | 71 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @param $key |
76 | 76 | * @return |
77 | 77 | */ |
78 | - public function deleteService($key){ |
|
78 | + public function deleteService($key) { |
|
79 | 79 | unset($this->services[$key]); |
80 | 80 | } |
81 | 81 |
@@ -31,13 +31,13 @@ |
||
31 | 31 | |
32 | 32 | |
33 | 33 | /** |
34 | - * Calls a method on a service (registered as a callable) with |
|
35 | - * content/payload of given message as argument. |
|
36 | - * |
|
37 | - * @access protected |
|
38 | - * @param \PEIP\INF\Message\Message $message message to call the service with it�s content/payload |
|
39 | - * @return mixed result of calling the registered service callable with message content/payload |
|
40 | - */ |
|
34 | + * Calls a method on a service (registered as a callable) with |
|
35 | + * content/payload of given message as argument. |
|
36 | + * |
|
37 | + * @access protected |
|
38 | + * @param \PEIP\INF\Message\Message $message message to call the service with it�s content/payload |
|
39 | + * @return mixed result of calling the registered service callable with message content/payload |
|
40 | + */ |
|
41 | 41 | protected function callService(\PEIP\INF\Message\Message $message){ |
42 | 42 | $res = NULL; |
43 | 43 | if(is_callable($this->serviceCallable)){ |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @author timo |
13 | 13 | */ |
14 | 14 | |
15 | -class HeaderServiceActivator extends \PEIP\Service\ServiceActivator{ |
|
15 | +class HeaderServiceActivator extends \PEIP\Service\ServiceActivator { |
|
16 | 16 | |
17 | 17 | protected $headerName; |
18 | 18 | |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * @param $outputChannel |
25 | 25 | * @return |
26 | 26 | */ |
27 | - public function __construct($serviceCallable, $headerName, \PEIP\INF\Channel\Channel $inputChannel = NULL, \PEIP\INF\Channel\Channel $outputChannel = NULL){ |
|
27 | + public function __construct($serviceCallable, $headerName, \PEIP\INF\Channel\Channel $inputChannel = NULL, \PEIP\INF\Channel\Channel $outputChannel = NULL) { |
|
28 | 28 | $this->headerName = $headerName; |
29 | 29 | parent::__construct($serviceCallable, $inputChannel, $outputChannel); |
30 | 30 | } |
@@ -38,12 +38,12 @@ discard block |
||
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 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $name = is_object($name) ? get_class($name) : (string)$name; |
23 | 23 | if(Test::assertClassOrInterfaceExists($name)){ |
24 | 24 | parent::connect($name, $listener); |
25 | - }else{ |
|
25 | + } else{ |
|
26 | 26 | throw new \InvalidArgumentException($name." is not an Class nor Interface"); |
27 | 27 | } |
28 | 28 | } |
@@ -22,19 +22,19 @@ |
||
22 | 22 | |
23 | 23 | interface MessageDispatcher { |
24 | 24 | |
25 | - public function connect($name, \PEIP\INF\Message\MessageHandler $handler); |
|
25 | + public function connect($name, \PEIP\INF\Message\MessageHandler $handler); |
|
26 | 26 | |
27 | - public function disconnect($name, \PEIP\INF\Message\MessageHandler $handler); |
|
27 | + public function disconnect($name, \PEIP\INF\Message\MessageHandler $handler); |
|
28 | 28 | |
29 | - public function notify( $event); |
|
29 | + public function notify( $event); |
|
30 | 30 | |
31 | - public function notifyUntil( $event); |
|
31 | + public function notifyUntil( $event); |
|
32 | 32 | |
33 | - public function filter( $event, $value); |
|
33 | + public function filter( $event, $value); |
|
34 | 34 | |
35 | - public function hasListeners($name); |
|
35 | + public function hasListeners($name); |
|
36 | 36 | |
37 | - public function getListeners($name); |
|
37 | + public function getListeners($name); |
|
38 | 38 | |
39 | 39 | } |
40 | 40 |
@@ -26,11 +26,11 @@ |
||
26 | 26 | |
27 | 27 | public function disconnect($name, \PEIP\INF\Message\MessageHandler $handler); |
28 | 28 | |
29 | - public function notify( $event); |
|
29 | + public function notify($event); |
|
30 | 30 | |
31 | - public function notifyUntil( $event); |
|
31 | + public function notifyUntil($event); |
|
32 | 32 | |
33 | - public function filter( $event, $value); |
|
33 | + public function filter($event, $value); |
|
34 | 34 | |
35 | 35 | public function hasListeners($name); |
36 | 36 |
@@ -22,18 +22,18 @@ |
||
22 | 22 | |
23 | 23 | interface ParameterHolder { |
24 | 24 | |
25 | - public function setParameters(array $parameters); |
|
25 | + public function setParameters(array $parameters); |
|
26 | 26 | |
27 | - public function addParameters(array $parameters); |
|
27 | + public function addParameters(array $parameters); |
|
28 | 28 | |
29 | - public function getParameters(); |
|
29 | + public function getParameters(); |
|
30 | 30 | |
31 | - public function getParameter($name); |
|
31 | + public function getParameter($name); |
|
32 | 32 | |
33 | - public function setParameter($name, $value); |
|
33 | + public function setParameter($name, $value); |
|
34 | 34 | |
35 | - public function hasParameter($name); |
|
35 | + public function hasParameter($name); |
|
36 | 36 | |
37 | - public function deleteParameter($name); |
|
37 | + public function deleteParameter($name); |
|
38 | 38 | |
39 | 39 | } |
@@ -25,26 +25,26 @@ |
||
25 | 25 | |
26 | 26 | interface StoreCollection { |
27 | 27 | |
28 | - public function setValues($namespace, array $parameters); |
|
28 | + public function setValues($namespace, array $parameters); |
|
29 | 29 | |
30 | - public function addValues($namespace, array $parameters); |
|
30 | + public function addValues($namespace, array $parameters); |
|
31 | 31 | |
32 | - public function getValues($namespace); |
|
32 | + public function getValues($namespace); |
|
33 | 33 | |
34 | - public function getValue($namespace, $name); |
|
34 | + public function getValue($namespace, $name); |
|
35 | 35 | |
36 | - public function setValue($namespace, $name, $value); |
|
36 | + public function setValue($namespace, $name, $value); |
|
37 | 37 | |
38 | - public function hasValue($namespace, $name); |
|
38 | + public function hasValue($namespace, $name); |
|
39 | 39 | |
40 | - public function deleteValue($namespace, $name); |
|
40 | + public function deleteValue($namespace, $name); |
|
41 | 41 | |
42 | - public function setStore($namespace, \PEIP\INF\Data\Store $store); |
|
42 | + public function setStore($namespace, \PEIP\INF\Data\Store $store); |
|
43 | 43 | |
44 | - public function getStore($namespace); |
|
44 | + public function getStore($namespace); |
|
45 | 45 | |
46 | - public function hasStore($namespace); |
|
46 | + public function hasStore($namespace); |
|
47 | 47 | |
48 | - public function deleteStore($namespace); |
|
48 | + public function deleteStore($namespace); |
|
49 | 49 | |
50 | 50 | } |
51 | 51 | \ No newline at end of file |