@@ -39,7 +39,7 @@ |
||
39 | 39 | * |
40 | 40 | * @access public |
41 | 41 | * @param string $className class-name to create objects for |
42 | - * @param ReflectionClass $reflectionClass reflection-class for class. default: NULL |
|
42 | + * @param \ReflectionClass $reflectionClass reflection-class for class. default: NULL |
|
43 | 43 | * @param boolean $storeRef wether to store a reference for new instance. default: true |
44 | 44 | * @return |
45 | 45 | */ |
@@ -83,7 +83,6 @@ |
||
83 | 83 | * @param ObjectEventDispatcher $dispatcher the dispatcher to dispatch the event |
84 | 84 | * @param mixed $subject the subject for the event |
85 | 85 | * @param string $name the name of the event |
86 | - * @param array $parameters the headers for the event |
|
87 | 86 | * @return |
88 | 87 | */ |
89 | 88 | public function buildAndDispatch(ObjectEventDispatcher $dispatcher, $subject, $name, array $headers = array()){ |
@@ -47,6 +47,9 @@ |
||
47 | 47 | return new DedicatedFactory(array($class, '__construct'), $parameters); |
48 | 48 | } |
49 | 49 | |
50 | + /** |
|
51 | + * @param string[] $callable |
|
52 | + */ |
|
50 | 53 | public static function getfromCallable($callable, array $parameters = array()){ |
51 | 54 | return new DedicatedFactory($callable, $parameters); |
52 | 55 | } |
@@ -112,6 +112,9 @@ |
||
112 | 112 | ); |
113 | 113 | } |
114 | 114 | |
115 | + /** |
|
116 | + * @param string $key |
|
117 | + */ |
|
115 | 118 | public function provideService($key){ |
116 | 119 | $this->doFireEvent(self::EVENT_BEFORE_PROVIDE_SERVICE, array( |
117 | 120 | self::HEADER_KEY=>$key) |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | if($this->hasService($key)){ |
120 | 120 | $service = $this->getService($key); |
121 | - }else{ |
|
121 | + } else{ |
|
122 | 122 | $service = $this->createService($key); |
123 | 123 | } |
124 | 124 | |
@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | )); |
151 | 151 | |
152 | 152 | return $node; |
153 | - }else{ |
|
153 | + } else{ |
|
154 | 154 | $errorMessage = 'COULD NOT BUILD NODE FOR KEY: '.$key; |
155 | 155 | } |
156 | 156 | |
157 | - }else{ |
|
157 | + } else{ |
|
158 | 158 | $errorMessage = 'NO CONFIG FOR KEY: '.$key; |
159 | 159 | } |
160 | 160 | $this->doFireEvent(self::EVENT_CREATE_SERVICE_ERROR, array( |
@@ -198,10 +198,10 @@ discard block |
||
198 | 198 | self::HEADER_NODE => $nodeInstance |
199 | 199 | )); |
200 | 200 | return $nodeInstance; |
201 | - }else{ |
|
201 | + } else{ |
|
202 | 202 | $errorMessage = 'BUILDER RETURNED NO OBJECT FOR NODE-TYPE: '.$nodeName; |
203 | 203 | } |
204 | - }else{ |
|
204 | + } else{ |
|
205 | 205 | $errorMessage = 'NO BUILDER FOUND FOR NODE-TYPE: '.$nodeName; |
206 | 206 | } |
207 | 207 |
@@ -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 | } |
@@ -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 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @access public |
24 | 24 | * @param string $name name of the event |
25 | 25 | * @param \PEIP\INF\Event\Event $object an event object |
26 | - * @return boolean |
|
26 | + * @return boolean|null |
|
27 | 27 | */ |
28 | 28 | public function notify($name, $object){ |
29 | 29 | if($object instanceof \PEIP\INF\Event\Event){ |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @param array $headers headers of the event-object as key/value pairs |
54 | 54 | * @param string $eventClass event-class to create instances from |
55 | 55 | * @return |
56 | - * @see EventBuilder |
|
56 | + boolean|null @see EventBuilder |
|
57 | 57 | */ |
58 | 58 | public function buildAndNotify($name, $object, array $headers = array(), $eventClass = false, $type = false){ |
59 | 59 | if(!$this->hasListeners($name, ($object))){ |
@@ -43,7 +43,7 @@ |
||
43 | 43 | class_exists($className); |
44 | 44 | $res = ReflectionPool::getInstance($className) |
45 | 45 | ->implementsInterface($interfaceName); |
46 | - } catch (\Exception $e){ |
|
46 | + } catch (\Exception $e){ |
|
47 | 47 | $res = false; |
48 | 48 | } |
49 | 49 | return $res;; |
@@ -57,7 +57,7 @@ |
||
57 | 57 | var_dump($drinks); |
58 | 58 | } |
59 | 59 | |
60 | -}else{ |
|
60 | +} else{ |
|
61 | 61 | throw new RuntimeException('Could not get CafeGateway'); |
62 | 62 | } |
63 | 63 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | |
39 | 39 | /** |
40 | 40 | * @access public |
41 | - * @param $name |
|
41 | + * @param string $name |
|
42 | 42 | * @param Callable|PEIP\INF\Handler\Handler $listener |
43 | 43 | * @return |
44 | 44 | */ |