Completed
Push — 4.0 ( 0fc1f3...2aa397 )
by Marco
02:59
created
src/Comodojo/Dispatcher/Request/File.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     public function getLocalName() {
63 63
 
64 64
         if (!empty($this->path))
65
-            return $this->path . "/" . $this->slug;
65
+            return $this->path."/".$this->slug;
66 66
         else
67 67
             return '';
68 68
 
@@ -183,17 +183,17 @@  discard block
 block discarded – undo
183 183
 
184 184
         preg_match_all("/[a-z0-9]+/", iconv("UTF-8", "ASCII//TRANSLIT", strtolower(preg_replace('/\..*?$/', '', $this->fname))), $matches);
185 185
 
186
-        $this->slug  = implode('-', $matches[0]);
186
+        $this->slug = implode('-', $matches[0]);
187 187
 
188 188
         if (!empty($this->path)) {
189 189
 
190
-            $files = glob($this->path . "/" . $slug . "*");
190
+            $files = glob($this->path."/".$slug."*");
191 191
 
192
-            $count = count ($files);
192
+            $count = count($files);
193 193
 
194 194
             if ($count > 0) {
195 195
 
196
-                $this->slug .= "-" . $count;
196
+                $this->slug .= "-".$count;
197 197
 
198 198
             }
199 199
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -6 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
 
@@ -102,8 +103,9 @@  discard block
 block discarded – undo
102 103
 
103 104
         $file = $this->getTemporaryName();
104 105
 
105
-        if (file_exists($file))
106
-            return file_get_contents($file);
106
+        if (file_exists($file)) {
107
+                    return file_get_contents($file);
108
+        }
107 109
 
108 110
         throw new DispatcherException("File does not exists");
109 111
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Request/Model.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 
53 53
         $this->version = new Version();
54 54
         
55
-        $repo = (!empty($configuration->get('repository')))?$configuration->get('base-path') . "/" . $configuration->get('repository'):'';
55
+        $repo = (!empty($configuration->get('repository'))) ? $configuration->get('base-path')."/".$configuration->get('repository') : '';
56 56
         
57 57
         $this->file = File::fromUploadedFiles($repo);
58 58
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Router/Route.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
     public function getServiceName() {
74 74
 
75
-        return (empty($this->service))?"default":implode('.', $this->service);
75
+        return (empty($this->service)) ? "default" : implode('.', $this->service);
76 76
 
77 77
     }
78 78
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
         $parameters = $this->parameters;
98 98
 
99
-        return (isset($parameters[$key]))?$parameters[$key]:null;
99
+        return (isset($parameters[$key])) ? $parameters[$key] : null;
100 100
 
101 101
     }
102 102
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
         $parameters = $this->request;
128 128
 
129
-        return (isset($parameters[$key]))?$parameters[$key]:null;
129
+        return (isset($parameters[$key])) ? $parameters[$key] : null;
130 130
 
131 131
     }
132 132
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
         $query = $this->query;
171 171
 
172
-        return isset($query[$key])?$query[$key]["required"]:false;
172
+        return isset($query[$key]) ? $query[$key]["required"] : false;
173 173
 
174 174
     }
175 175
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
         $query = $this->query;
179 179
 
180
-        return isset($query[$key])?$query[$key]["regex"]:null;
180
+        return isset($query[$key]) ? $query[$key]["regex"] : null;
181 181
 
182 182
     }
183 183
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
                 /* if it's available a bit associated with the parameter name, it is compared against
219 219
                  * it's regular expression in order to extrect backreferences
220 220
                  */
221
-                if (preg_match('/^' . $value['regex'] . '$/', $path[$key], $matches)) {
221
+                if (preg_match('/^'.$value['regex'].'$/', $path[$key], $matches)) {
222 222
 
223 223
                     if (count($matches) == 1) $matches = $matches[0]; // This is the case where no backreferences are present or available.
224 224
 
Please login to merge, or discard this patch.
src/Comodojo/Dispatcher/Router/Table.php 1 patch
Braces   +11 added lines, -6 removed lines patch added patch discarded remove patch
@@ -78,10 +78,11 @@  discard block
 block discarded – undo
78 78
 
79 79
         $regex = $this->regex($route);
80 80
 
81
-        if (isset($this->routes[$regex]))
82
-            return $this->routes[$regex];
83
-        else
84
-            return null;
81
+        if (isset($this->routes[$regex])) {
82
+                    return $this->routes[$regex];
83
+        } else {
84
+                    return null;
85
+        }
85 86
 
86 87
     }
87 88
 
@@ -139,7 +140,9 @@  discard block
 block discarded – undo
139 140
 
140 141
     private function readCache() {
141 142
 
142
-        if ( $this->configuration->get('routing-table-cache') !== true ) return;
143
+        if ( $this->configuration->get('routing-table-cache') !== true ) {
144
+            return;
145
+        }
143 146
 
144 147
         $this->routes = $this->cache->setNamespace('dispatcherinternals')->get("dispatcher-routes");
145 148
 
@@ -157,7 +160,9 @@  discard block
 block discarded – undo
157 160
 
158 161
     private function dumpCache() {
159 162
 
160
-        if ( $this->configuration->get('routing-table-cache') !== true ) return;
163
+        if ( $this->configuration->get('routing-table-cache') !== true ) {
164
+            return;
165
+        }
161 166
 
162 167
         $ttl = $this->configuration->get('routing-table-ttl');
163 168
 
Please login to merge, or discard this patch.