@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | protected function uri() : string |
| 102 | 102 | { |
| 103 | - return trim(strtok( $_SERVER['REQUEST_URI'], '?'), '/'); |
|
| 103 | + return trim(strtok($_SERVER['REQUEST_URI'], '?'), '/'); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -120,13 +120,13 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | protected function checkCommonProblems() |
| 122 | 122 | { |
| 123 | - if(self::hasRouteValid()) { |
|
| 123 | + if (self::hasRouteValid()) { |
|
| 124 | 124 | return false; |
| 125 | 125 | } |
| 126 | - if(empty( $this->routeStack)) { |
|
| 126 | + if (empty($this->routeStack)) { |
|
| 127 | 127 | throw new \InvalidArgumentException('Routing empty'); |
| 128 | 128 | } |
| 129 | - if(!isset($this->routeStack[self::method()])) { |
|
| 129 | + if (!isset($this->routeStack[self::method()])) { |
|
| 130 | 130 | throw new MethodNotAllowedException('Requested method was not scaled.'); |
| 131 | 131 | } |
| 132 | 132 | return true; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | { |
| 146 | 146 | $route = new Route($path, $callable); |
| 147 | 147 | $this->routeStack[$method][] = $route; |
| 148 | - if($name) { |
|
| 148 | + if ($name) { |
|
| 149 | 149 | $this->routesGroupByName[$name] = $route; |
| 150 | 150 | } |
| 151 | 151 | return $route; |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | { |
| 161 | 161 | foreach ($this->routeStack[self::method()] as $route) { |
| 162 | 162 | /** @var $route Route */ |
| 163 | - if($route->extractParameters(self::uri())) { |
|
| 163 | + if ($route->extractParameters(self::uri())) { |
|
| 164 | 164 | return $route->run(); |
| 165 | 165 | } |
| 166 | 166 | } |
@@ -177,8 +177,8 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | public function goUrl($name, $params = []) |
| 179 | 179 | { |
| 180 | - if(!isset($this->routesGroupByName[$name])) { |
|
| 181 | - throw new UnregisteredRouteException('Unregistered route by name ' . $name); |
|
| 180 | + if (!isset($this->routesGroupByName[$name])) { |
|
| 181 | + throw new UnregisteredRouteException('Unregistered route by name '.$name); |
|
| 182 | 182 | } |
| 183 | 183 | /** @var Route $route */ |
| 184 | 184 | $route = $this->routesGroupByName[$name]; |