@@ -11,7 +11,7 @@ |
||
11 | 11 | * |
12 | 12 | * @author timo |
13 | 13 | */ |
14 | -use PEIP\Event\EventBuilder; |
|
14 | +use PEIP\Event\EventBuilder; |
|
15 | 15 | use PEIP\Util\ReflectionPool; |
16 | 16 | |
17 | 17 | class EventClassDispatcher |
@@ -70,10 +70,10 @@ |
||
70 | 70 | ), |
71 | 71 | $object |
72 | 72 | ); |
73 | - }else{ |
|
73 | + } else{ |
|
74 | 74 | throw new \InvalidArgumentException('instance of \PEIP\INF\Event\Event must contain subject'); |
75 | 75 | } |
76 | - }else{ |
|
76 | + } else{ |
|
77 | 77 | throw new \InvalidArgumentException('object must be instance of \PEIP\INF\Event\Event'); |
78 | 78 | } |
79 | 79 | } //put your code here |
@@ -11,8 +11,8 @@ |
||
11 | 11 | * |
12 | 12 | * @author timo |
13 | 13 | */ |
14 | -use PEIP\Util\Test; |
|
15 | -use PEIP\Base\GenericBuilder; |
|
14 | +use PEIP\Util\Test; |
|
15 | +use PEIP\Base\GenericBuilder; |
|
16 | 16 | use PEIP\Context\XMLContext; |
17 | 17 | |
18 | 18 | class ServiceFactory { |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | $constructor = isset($config["constructor"])?(string)$config["constructor"]:""; |
52 | 52 | if($constructor != '' && Test::assertMethod($cls, $constructor)){ |
53 | 53 | $service = call_user_func_array(array($cls, $constructor), $arguments); |
54 | - }else{ |
|
54 | + } else{ |
|
55 | 55 | $service = self::build($cls, $arguments); |
56 | 56 | } |
57 | - }catch(\Exception $e){ |
|
57 | + } catch(\Exception $e){ |
|
58 | 58 | throw new \RuntimeException('Could not create Service "'.$cls.'" -> '.$e->getMessage()); |
59 | 59 | } |
60 | 60 | } |
@@ -89,26 +89,26 @@ discard block |
||
89 | 89 | protected static function buildArg($config){ |
90 | 90 | if(trim((string)$config['value']) != ''){ |
91 | 91 | $arg = (string)$config['value']; |
92 | - }elseif($config->getName() == 'value'){ |
|
92 | + } elseif($config->getName() == 'value'){ |
|
93 | 93 | $arg = (string)$config; |
94 | - }elseif($config->getName() == 'list'){ |
|
94 | + } elseif($config->getName() == 'list'){ |
|
95 | 95 | $arg = array(); |
96 | 96 | foreach($config->children() as $entry){ |
97 | 97 | if($entry->getName() == 'value'){ |
98 | 98 | if($entry['key']){ |
99 | 99 | $arg[(string)$entry['key']] = (string)$entry; |
100 | - }else{ |
|
100 | + } else{ |
|
101 | 101 | $arg[] = (string)$entry; |
102 | 102 | } |
103 | - }elseif($entry->getName() == 'service'){ |
|
103 | + } elseif($entry->getName() == 'service'){ |
|
104 | 104 | $arg[] = $this->provideService($entry); |
105 | 105 | } |
106 | 106 | } |
107 | - }elseif($config->getName() == 'service'){ |
|
107 | + } elseif($config->getName() == 'service'){ |
|
108 | 108 | $arg = self::provideService($config); |
109 | - }elseif($config->list){ |
|
109 | + } elseif($config->list){ |
|
110 | 110 | $arg = self::buildArg($config->list); |
111 | - }elseif($config->service){ |
|
111 | + } elseif($config->service){ |
|
112 | 112 | $arg = self::buildArg($config->service); |
113 | 113 | } |
114 | 114 | return $arg; |
@@ -129,12 +129,12 @@ discard block |
||
129 | 129 | public static function buildAndModify($config, $arguments, $defaultClass = ""){ |
130 | 130 | if((isset($config["class"]) && "" != (string)$config["class"]) || $defaultClass !== ""){ |
131 | 131 | $service = ServiceFactory::doBuild($config, $arguments, $defaultClass); |
132 | - }else{ |
|
132 | + } else{ |
|
133 | 133 | throw new \RuntimeException('Could not create Service. no class or reference given.'); |
134 | 134 | } |
135 | 135 | if(isset($config["ref_property"])){ |
136 | 136 | $service = $service->{(string)$config["ref_property"]}; |
137 | - }elseif(isset($config["ref_method"])){ |
|
137 | + } elseif(isset($config["ref_method"])){ |
|
138 | 138 | $args = array(); |
139 | 139 | if($config->argument){ |
140 | 140 | foreach($config->argument as $arg){ |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $setter = self::getSetter($property); |
178 | 178 | if($setter && self::hasPublicProperty($service, 'Method', $setter)){ |
179 | 179 | $service->{$setter}($arg); |
180 | - }elseif(in_array($property, self::hasPublicProperty($service, 'Property', $setter))){ |
|
180 | + } elseif(in_array($property, self::hasPublicProperty($service, 'Property', $setter))){ |
|
181 | 181 | $service->$setter = $arg; |
182 | 182 | } |
183 | 183 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | * @implements \PEIP\INF\Base\Container, \PEIP\INF\Message\Message, \PEIP\INF\Base\Buildable |
21 | 21 | */ |
22 | 22 | |
23 | -use PEIP\Util\Test; |
|
23 | +use PEIP\Util\Test; |
|
24 | 24 | use PEIP\Base\GenericBuilder; |
25 | 25 | |
26 | 26 | class GenericMessage |
@@ -134,12 +134,10 @@ |
||
134 | 134 | $res = false; |
135 | 135 | try { |
136 | 136 | $res = (string)$this->getContent(); |
137 | - } |
|
138 | - catch(\Exception $e){ |
|
137 | + } catch(\Exception $e){ |
|
139 | 138 | try { |
140 | 139 | $res = get_class($this->getContent()); |
141 | - } |
|
142 | - catch(\Exception $e){ |
|
140 | + } catch(\Exception $e){ |
|
143 | 141 | |
144 | 142 | } |
145 | 143 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | * |
12 | 12 | * @author timo |
13 | 13 | */ |
14 | -use PEIP\Context\XMLContext; |
|
14 | +use PEIP\Context\XMLContext; |
|
15 | 15 | use PEIP\Plugins\BasePlugin; |
16 | 16 | |
17 | 17 | class ServiceProvider extends \PEIP\Service\ServiceContainer { |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | if($this->hasService($key)){ |
121 | 121 | $service = $this->getService($key); |
122 | - }else{ |
|
122 | + } else{ |
|
123 | 123 | $service = $this->createService($key); |
124 | 124 | } |
125 | 125 | |
@@ -151,11 +151,11 @@ discard block |
||
151 | 151 | )); |
152 | 152 | |
153 | 153 | return $node; |
154 | - }else{ |
|
154 | + } else{ |
|
155 | 155 | $errorMessage = 'COULD NOT BUILD NODE FOR KEY: '.$key; |
156 | 156 | } |
157 | 157 | |
158 | - }else{ |
|
158 | + } else{ |
|
159 | 159 | $errorMessage = 'NO CONFIG FOR KEY: '.$key; |
160 | 160 | } |
161 | 161 | $this->doFireEvent(self::EVENT_CREATE_SERVICE_ERROR, array( |
@@ -199,10 +199,10 @@ discard block |
||
199 | 199 | self::HEADER_NODE => $nodeInstance |
200 | 200 | )); |
201 | 201 | return $nodeInstance; |
202 | - }else{ |
|
202 | + } else{ |
|
203 | 203 | $errorMessage = 'BUILDER RETURNED NO OBJECT FOR NODE-TYPE: '.$nodeName; |
204 | 204 | } |
205 | - }else{ |
|
205 | + } else{ |
|
206 | 206 | $errorMessage = 'NO BUILDER FOUND FOR NODE-TYPE: '.$nodeName; |
207 | 207 | } |
208 | 208 |
@@ -39,7 +39,7 @@ |
||
39 | 39 | if($cold){ |
40 | 40 | $type = 'cold'; |
41 | 41 | $count = $this->coldDrinkCounter; |
42 | - }else{ |
|
42 | + } else{ |
|
43 | 43 | $type = 'hot'; |
44 | 44 | $count = $this->hotDrinkCounter; |
45 | 45 | } |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | $array = array(); |
27 | 27 | try { |
28 | 28 | $node = simplexml_load_string($content); |
29 | - } |
|
30 | - catch(\Exception $e){ |
|
29 | + } catch(\Exception $e){ |
|
31 | 30 | return false; |
32 | 31 | } |
33 | 32 | |
@@ -61,7 +60,7 @@ discard block |
||
61 | 60 | ) |
62 | 61 | ); |
63 | 62 | } |
64 | - }else{ |
|
63 | + } else{ |
|
65 | 64 | $array[$name] = array(); |
66 | 65 | } |
67 | 66 | $array[$name][] = $res; |
@@ -104,7 +104,7 @@ discard block |
||
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 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | foreach($listeners as $listener){ |
212 | 212 | if($listener instanceof \PEIP\INF\Handler\Handler){ |
213 | 213 | $listener->handle($subject); |
214 | - }elseif(is_callable($listener)){ |
|
214 | + } elseif(is_callable($listener)){ |
|
215 | 215 | call_user_func($listener, $subject); |
216 | 216 | } |
217 | 217 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | * @implements \PEIP\INF\Base\Container, \PEIP\INF\Message\Message, \PEIP\INF\Base\Buildable |
21 | 21 | */ |
22 | 22 | |
23 | -use PEIP\Util\Test; |
|
23 | +use PEIP\Util\Test; |
|
24 | 24 | use PEIP\Base\GenericBuilder; |
25 | 25 | |
26 | 26 | class GenericMessage |
@@ -70,10 +70,10 @@ |
||
70 | 70 | ), |
71 | 71 | $object |
72 | 72 | ); |
73 | - }else{ |
|
73 | + } else{ |
|
74 | 74 | throw new \InvalidArgumentException('instance of \PEIP\INF\Event\Event must contain subject'); |
75 | 75 | } |
76 | - }else{ |
|
76 | + } else{ |
|
77 | 77 | throw new \InvalidArgumentException('object must be instance of \PEIP\INF\Event\Event'); |
78 | 78 | } |
79 | 79 | } //put your code here |
@@ -11,7 +11,7 @@ |
||
11 | 11 | * |
12 | 12 | * @author timo |
13 | 13 | */ |
14 | -use PEIP\Util\Reflection; |
|
14 | +use PEIP\Util\Reflection; |
|
15 | 15 | use PEIP\Event\EventBuilder; |
16 | 16 | |
17 | 17 | class ClassEventDispatcher extends \PEIP\Dispatcher\ObjectEventDispatcher { |
@@ -116,8 +116,7 @@ |
||
116 | 116 | $this->send($content); |
117 | 117 | try { |
118 | 118 | $res = $this->receive(); |
119 | - } |
|
120 | - catch(\Exception $e){ |
|
119 | + } catch(\Exception $e){ |
|
121 | 120 | return NULL; |
122 | 121 | } |
123 | 122 | return $res; |