Completed
Push — 4.0 ( 0e3cc0...125a8d )
by Marco
03:38
created
src/Comodojo/Dispatcher/Dispatcher.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -201,8 +201,8 @@
 block discarded – undo
201 201
 
202 202
         $params = $route->getParameter('headers');
203 203
 
204
-        if ( !empty($params) && is_array($params) ) {
205
-            foreach($params as $name => $value) {
204
+        if (!empty($params) && is_array($params)) {
205
+            foreach ($params as $name => $value) {
206 206
                 $this->getResponse()->getHeaders()->set($name, $value);
207 207
             }
208 208
         }
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Cache/ServerCache.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,9 @@
 block discarded – undo
47 47
 
48 48
         $cache_object = $this->getCache()->setNamespace(self::$cache_namespace)->get($name);
49 49
 
50
-        if (is_null($cache_object)) return false;
50
+        if (is_null($cache_object)) {
51
+            return false;
52
+        }
51 53
 
52 54
         $response->import($cache_object);
53 55
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Components/HttpStatusCodes.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,9 @@
 block discarded – undo
102 102
 
103 103
     public function getMessage($code) {
104 104
 
105
-        if ($this->exists($code)) return $this->codes[$code];
105
+        if ($this->exists($code)) {
106
+            return $this->codes[$code];
107
+        }
106 108
 
107 109
         throw new Exception("Invalid HTTP status code $code");
108 110
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Request/Headers.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@
 block discarded – undo
41 41
      */
42 42
     private static function getHeaders() {
43 43
 
44
-        if (function_exists('getallheaders')) return getallheaders();
44
+        if (function_exists('getallheaders')) {
45
+            return getallheaders();
46
+        }
45 47
 
46 48
         $headers = array();
47 49
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Router/Table.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -156,7 +156,9 @@  discard block
 block discarded – undo
156 156
 
157 157
     private function readCache() {
158 158
 
159
-        if ($this->configuration->get('routing-table-cache') !== true) return;
159
+        if ($this->configuration->get('routing-table-cache') !== true) {
160
+            return;
161
+        }
160 162
 
161 163
         $data = $this->cache->read();
162 164
 
@@ -176,7 +178,9 @@  discard block
 block discarded – undo
176 178
 
177 179
     private function dumpCache() {
178 180
 
179
-        if ($this->configuration->get('routing-table-cache') !== true) return;
181
+        if ($this->configuration->get('routing-table-cache') !== true) {
182
+            return;
183
+        }
180 184
 
181 185
         $ttl = $this->configuration->get('routing-table-ttl');
182 186
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Router/Model.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,9 @@
 block discarded – undo
123 123
 
124 124
         if ($this->bypass_routing === false) {
125 125
 
126
-            if (!$this->parse()) throw new DispatcherException("Unable to find a valid route for the specified uri", 0, null, 404);
126
+            if (!$this->parse()) {
127
+                throw new DispatcherException("Unable to find a valid route for the specified uri", 0, null, 404);
128
+            }
127 129
 
128 130
         }
129 131
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Output/Processor.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,9 @@
 block discarded – undo
75 75
 
76 76
         $status = $response->getStatus()->get();
77 77
 
78
-        if (!$this->codes->exists($status)) throw new Exception("Invalid HTTP status code in response");
78
+        if (!$this->codes->exists($status)) {
79
+            throw new Exception("Invalid HTTP status code in response");
80
+        }
79 81
 
80 82
         $message = $this->codes->getMessage($status);
81 83
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Traits/HeadersTrait.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,11 +28,13 @@
 block discarded – undo
28 28
 
29 29
     public function get($header = null) {
30 30
 
31
-        if (is_null($header)) return $this->headers;
32
-
33
-        else if (array_key_exists($header, $this->headers)) return $this->headers[$header];
34
-
35
-        else return null;
31
+        if (is_null($header)) {
32
+            return $this->headers;
33
+        } else if (array_key_exists($header, $this->headers)) {
34
+            return $this->headers[$header];
35
+        } else {
36
+            return null;
37
+        }
36 38
 
37 39
     }
38 40
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Response/Status.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@
 block discarded – undo
60 60
 
61 61
     }
62 62
 
63
-    public function description($code=null) {
63
+    public function description($code = null) {
64 64
 
65
-        if ( is_null($code) ) return $this->codes->getMessage($this->status_code);
65
+        if (is_null($code)) return $this->codes->getMessage($this->status_code);
66 66
 
67 67
         return $this->codes->getMessage($code);
68 68
 
Please login to merge, or discard this patch.