Completed
Push — 4.0 ( bf6233...a1234e )
by Marco
13:59
created
src/Comodojo/Dispatcher/Response/File.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -61,10 +61,11 @@  discard block
 block discarded – undo
61 61
     
62 62
     public function getLocalName() {
63 63
         
64
-        if (!empty($this->path))
65
-            return $this->path . "/" . $this->slug;
66
-        else
67
-            return '';
64
+        if (!empty($this->path)) {
65
+                    return $this->path . "/" . $this->slug;
66
+        } else {
67
+                    return '';
68
+        }
68 69
     
69 70
     }
70 71
     
@@ -101,11 +102,13 @@  discard block
 block discarded – undo
101 102
     public function getFileData() {
102 103
    
103 104
         $file = $this->getTemporaryName();
104
-        if (empty($file))
105
-            $file = $this->getLocalName();
105
+        if (empty($file)) {
106
+                    $file = $this->getLocalName();
107
+        }
106 108
         
107
-        if (file_exists($file))
108
-            return file_get_contents($file);
109
+        if (file_exists($file)) {
110
+                    return file_get_contents($file);
111
+        }
109 112
         
110 113
         throw new DispatcherException("File does not exists");
111 114
     
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Router/Model.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,7 +105,9 @@  discard block
 block discarded – undo
105 105
 
106 106
         if (!$this->bypass_routing) {
107 107
 
108
-            if (!$this->parse()) throw new DispatcherException("Unable to find a valid route for the specified uri", 0, null, 404);
108
+            if (!$this->parse()) {
109
+                throw new DispatcherException("Unable to find a valid route for the specified uri", 0, null, 404);
110
+            }
109 111
 
110 112
         }
111 113
 
@@ -133,8 +135,9 @@  discard block
 block discarded – undo
133 135
                 $this->extra
134 136
             );
135 137
 
138
+        } else {
139
+            return null;
136 140
         }
137
-        else return null;
138 141
         
139 142
     }
140 143
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Router/Route.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -223,7 +223,10 @@
 block discarded – undo
223 223
                  */
224 224
                 if (preg_match('/^' . $value['regex'] . '$/', $bits[$key], $matches)) {
225 225
                     
226
-                    if (count($matches) == 1) $matches = $matches[0]; // This is the case where no backreferences are present or available.
226
+                    if (count($matches) == 1) {
227
+                        $matches = $matches[0];
228
+                    }
229
+                    // This is the case where no backreferences are present or available.
227 230
                     
228 231
                     // The extracted value (with any backreference available) is added to the query parameters.
229 232
                     $this->request->query()->set($key, $matches);
Please login to merge, or discard this patch.