@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $this->events = new Emitter(); |
| 64 | 64 | |
| 65 | - $this->cache = new CacheManager( CacheManager::PICK_FIRST ); |
|
| 65 | + $this->cache = new CacheManager(CacheManager::PICK_FIRST); |
|
| 66 | 66 | |
| 67 | 67 | $this->request = new Request($this->configuration, $this->logger); |
| 68 | 68 | |
@@ -110,33 +110,33 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | public function dispatch() { |
| 112 | 112 | |
| 113 | - $this->events->emit( new DispatcherEvent($this) ); |
|
| 113 | + $this->events->emit(new DispatcherEvent($this)); |
|
| 114 | 114 | |
| 115 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.request') ); |
|
| 115 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.request')); |
|
| 116 | 116 | |
| 117 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.request.'.$this->request->method()->get()) ); |
|
| 117 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.request.'.$this->request->method()->get())); |
|
| 118 | 118 | |
| 119 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.request.#') ); |
|
| 119 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.request.#')); |
|
| 120 | 120 | |
| 121 | 121 | $this->router->route($this->request); |
| 122 | 122 | |
| 123 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.route') ); |
|
| 123 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.route')); |
|
| 124 | 124 | |
| 125 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.route.'.$this->router->getType()) ); |
|
| 125 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.route.'.$this->router->getType())); |
|
| 126 | 126 | |
| 127 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.route.'.$this->router->getService()) ); |
|
| 127 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.route.'.$this->router->getService())); |
|
| 128 | 128 | |
| 129 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.route.#') ); |
|
| 129 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.route.#')); |
|
| 130 | 130 | |
| 131 | 131 | // translate route to service |
| 132 | 132 | |
| 133 | 133 | $this->router->compose($this->response); |
| 134 | 134 | |
| 135 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.response') ); |
|
| 135 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.response')); |
|
| 136 | 136 | |
| 137 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.response.'.$this->response->status()->get()) ); |
|
| 137 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.response.'.$this->response->status()->get())); |
|
| 138 | 138 | |
| 139 | - $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.response.#') ); |
|
| 139 | + $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.response.#')); |
|
| 140 | 140 | |
| 141 | 141 | $return = Processor::parse($this->configuration, $this->logger, $this->response); |
| 142 | 142 | |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | |
| 47 | 47 | private static function getParameters() { |
| 48 | 48 | |
| 49 | - switch( $_SERVER['REQUEST_METHOD'] ) { |
|
| 49 | + switch ($_SERVER['REQUEST_METHOD']) { |
|
| 50 | 50 | |
| 51 | 51 | case 'POST': |
| 52 | 52 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | foreach ($this->table as $regex => $value) { |
| 151 | 151 | |
| 152 | - if (preg_match("/" . $regex . "/", $path, $matches)) { |
|
| 152 | + if (preg_match("/".$regex."/", $path, $matches)) { |
|
| 153 | 153 | |
| 154 | 154 | $this->evalUri($value['query'], $matches); |
| 155 | 155 | |
@@ -175,13 +175,13 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | private function evalUri($parameters, $bits) { |
| 177 | 177 | |
| 178 | - $count = 0; |
|
| 178 | + $count = 0; |
|
| 179 | 179 | |
| 180 | 180 | foreach ($parameters as $key => $value) { |
| 181 | 181 | |
| 182 | 182 | if (isset($bits[$key])) { |
| 183 | 183 | |
| 184 | - if (preg_match('/' . $value['regex'] . '/', $bits[$key], $matches)) { |
|
| 184 | + if (preg_match('/'.$value['regex'].'/', $bits[$key], $matches)) { |
|
| 185 | 185 | |
| 186 | 186 | if (count($matches) == 1) $matches = $matches[0]; |
| 187 | 187 | |
@@ -124,14 +124,14 @@ |
||
| 124 | 124 | $value = preg_replace('/(?<!\\)\((?!\?)/', '(?:', $value); |
| 125 | 125 | $value = preg_replace('/\.([\*\+])(?!\?)/', '.\${1}?', $value); |
| 126 | 126 | |
| 127 | - $param_regex .= '(?P<' . $key . '>' . $value . ')' . (($field_required)?'{1}':'?'); |
|
| 127 | + $param_regex .= '(?P<'.$key.'>'.$value.')'.(($field_required) ? '{1}' : '?'); |
|
| 128 | 128 | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | $this->readpath( |
| 132 | 132 | $folders, |
| 133 | 133 | $value, |
| 134 | - $regex.'(?:\/'.$param_regex.')'. (($param_required)?'{1}':'?') |
|
| 134 | + $regex.'(?:\/'.$param_regex.')'.(($param_required) ? '{1}' : '?') |
|
| 135 | 135 | ); |
| 136 | 136 | |
| 137 | 137 | } else { |