Completed
Push — 4.0 ( 37a570...937edb )
by Marco
12:16
created
src/Comodojo/Dispatcher/Dispatcher.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
         // init core components
76 76
         // create new configuration object and merge configuration
77
-        $configuration_object = new Configuration( DefaultConfiguration::get() );
77
+        $configuration_object = new Configuration(DefaultConfiguration::get());
78 78
         $configuration_object->merge($configuration);
79 79
         $logger = is_null($logger) ? LogManager::createFromConfiguration($configuration_object)->getLogger() : $logger;
80 80
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             $this->setRaw('response', new Response($this->configuration, $this->logger));
96 96
 
97 97
         } catch (Exception $e) {
98
-            $this->logger->critical($e->getMessage(),$e->getTrace());
98
+            $this->logger->critical($e->getMessage(), $e->getTrace());
99 99
             throw $e;
100 100
         }
101 101
 
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 
111 111
         $this->logger->debug("Emitting global dispatcher event.");
112 112
 
113
-        $this->events->emit( new DispatcherEvent($this) );
113
+        $this->events->emit(new DispatcherEvent($this));
114 114
 
115
-        if ( $this->configuration->get('enabled') === false ) {
115
+        if ($this->configuration->get('enabled') === false) {
116 116
 
117 117
             $this->logger->debug("Dispatcher disabled, shutting down gracefully.");
118 118
 
@@ -130,13 +130,13 @@  discard block
 block discarded – undo
130 130
 
131 131
         $cache = new ServerCache($this->cache);
132 132
 
133
-        $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.request') );
133
+        $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.request'));
134 134
 
135
-        $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.request.'.$this->request->method->get()) );
135
+        $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.request.'.$this->request->method->get()));
136 136
 
137
-        $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.request.#') );
137
+        $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.request.#'));
138 138
 
139
-        if ( $cache->read($this->request, $this->response) ) {
139
+        if ($cache->read($this->request, $this->response)) {
140 140
 
141 141
             return $this->shutdown();
142 142
 
@@ -164,13 +164,13 @@  discard block
 block discarded – undo
164 164
 
165 165
         $this->logger->debug("Route acquired, type $route_type directed to $route_service");
166 166
 
167
-        $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.route') );
167
+        $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.route'));
168 168
 
169
-        $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.route.'.$route_type) );
169
+        $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.route.'.$route_type));
170 170
 
171
-        $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.route.'.$route_service) );
171
+        $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.route.'.$route_service));
172 172
 
173
-        $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.route.#') );
173
+        $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.route.#'));
174 174
 
175 175
         // translate route to service
176 176
 
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
 
201 201
         $params = $route->getParameter('headers');
202 202
 
203
-        if ( !empty($params) && is_array($params) ) {
203
+        if (!empty($params) && is_array($params)) {
204 204
 
205
-            foreach($params as $name=>$value) $this->response->headers->set($name, $value);
205
+            foreach ($params as $name=>$value) $this->response->headers->set($name, $value);
206 206
         }
207 207
 
208 208
     }
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
 
243 243
         $this->response->consolidate($this->request, $this->route);
244 244
 
245
-        $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.response') );
245
+        $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.response'));
246 246
 
247
-        $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.response.'.$this->response->status->get()) );
247
+        $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.response.'.$this->response->status->get()));
248 248
 
249
-        $this->events->emit( $this->emitServiceSpecializedEvents('dispatcher.response.#') );
249
+        $this->events->emit($this->emitServiceSpecializedEvents('dispatcher.response.#'));
250 250
 
251 251
         $this->logger->debug("Composing return value");
252 252
 
Please login to merge, or discard this patch.