@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | |
145 | 145 | public function dispatch() { |
146 | 146 | |
147 | - $this->events->emit( new DispatcherEvent($this) ); |
|
147 | + $this->events->emit(new DispatcherEvent($this)); |
|
148 | 148 | |
149 | - if ( $this->configuration()->get('dispatcher-enabled') === false ) { |
|
149 | + if ($this->configuration()->get('dispatcher-enabled') === false) { |
|
150 | 150 | |
151 | 151 | $status = $this->configuration()->get('dispatcher-disabled-status'); |
152 | 152 | |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | |
161 | 161 | } |
162 | 162 | |
163 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.request') ); |
|
163 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.request')); |
|
164 | 164 | |
165 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.request.'.$this->request->method()->get()) ); |
|
165 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.request.'.$this->request->method()->get())); |
|
166 | 166 | |
167 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.request.#') ); |
|
167 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.request.#')); |
|
168 | 168 | |
169 | 169 | try { |
170 | 170 | |
@@ -172,21 +172,21 @@ discard block |
||
172 | 172 | |
173 | 173 | } catch (DispatcherException $de) { |
174 | 174 | |
175 | - $this->response()->status()->set( $de->getStatus() ); |
|
175 | + $this->response()->status()->set($de->getStatus()); |
|
176 | 176 | |
177 | - $this->response()->content()->set( $de->getMessage() ); |
|
177 | + $this->response()->content()->set($de->getMessage()); |
|
178 | 178 | |
179 | 179 | return $this->shutdown(); |
180 | 180 | |
181 | 181 | } |
182 | 182 | |
183 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.route') ); |
|
183 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.route')); |
|
184 | 184 | |
185 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.route.'.$this->router->getType()) ); |
|
185 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.route.'.$this->router->getType())); |
|
186 | 186 | |
187 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.route.'.$this->router->getService()) ); |
|
187 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.route.'.$this->router->getService())); |
|
188 | 188 | |
189 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.route.#') ); |
|
189 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.route.#')); |
|
190 | 190 | |
191 | 191 | // translate route to service |
192 | 192 | |
@@ -196,9 +196,9 @@ discard block |
||
196 | 196 | |
197 | 197 | } catch (DispatcherException $de) { |
198 | 198 | |
199 | - $this->response()->status()->set( $de->getStatus() ); |
|
199 | + $this->response()->status()->set($de->getStatus()); |
|
200 | 200 | |
201 | - $this->response()->content()->set( $de->getMessage() ); |
|
201 | + $this->response()->content()->set($de->getMessage()); |
|
202 | 202 | |
203 | 203 | } |
204 | 204 | |
@@ -221,11 +221,11 @@ discard block |
||
221 | 221 | |
222 | 222 | private function shutdown() { |
223 | 223 | |
224 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.response') ); |
|
224 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.response')); |
|
225 | 225 | |
226 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.response.'.$this->response->status()->get()) ); |
|
226 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.response.'.$this->response->status()->get())); |
|
227 | 227 | |
228 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.response.#') ); |
|
228 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.response.#')); |
|
229 | 229 | |
230 | 230 | $return = Processor::parse($this->configuration, $this->logger, $this->response); |
231 | 231 |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | foreach ($this->table->routes() as $regex => $value) { |
190 | 190 | |
191 | - if (preg_match("/" . $regex . "/", $path, $matches)) { |
|
191 | + if (preg_match("/".$regex."/", $path, $matches)) { |
|
192 | 192 | |
193 | 193 | $this->evalUri($value['query'], $matches); |
194 | 194 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $this->classname = $value['class']; |
202 | 202 | $this->type = $value['type']; |
203 | 203 | $this->service = implode('.', $value['service']); |
204 | - $this->service = empty($this->service)?"default":$this->service; |
|
204 | + $this->service = empty($this->service) ? "default" : $this->service; |
|
205 | 205 | |
206 | 206 | return true; |
207 | 207 | |
@@ -215,13 +215,13 @@ discard block |
||
215 | 215 | |
216 | 216 | private function evalUri($parameters, $bits) { |
217 | 217 | |
218 | - $count = 0; |
|
218 | + $count = 0; |
|
219 | 219 | |
220 | 220 | foreach ($parameters as $key => $value) { |
221 | 221 | |
222 | 222 | if (isset($bits[$key])) { |
223 | 223 | |
224 | - if (preg_match('/^' . $value['regex'] . '$/', $bits[$key], $matches)) { |
|
224 | + if (preg_match('/^'.$value['regex'].'$/', $bits[$key], $matches)) { |
|
225 | 225 | |
226 | 226 | if (count($matches) == 1) $matches = $matches[0]; |
227 | 227 |