@@ -61,10 +61,11 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -105,7 +105,9 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -223,7 +223,10 @@ |
||
| 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); |