@@ -63,15 +63,17 @@ |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | public function url($methods, $args) { |
| 66 | - if (is_string($methods)) |
|
| 67 | - $methods = [$methods]; |
|
| 66 | + if (is_string($methods)) { |
|
| 67 | + $methods = [$methods]; |
|
| 68 | + } |
|
| 68 | 69 | |
| 69 | 70 | $pattern = array_shift($args); // 2nd-> Pattern |
| 70 | 71 | $callable = array_pop($args); // Last -> callable |
| 71 | 72 | $route = new Route($pattern, $callable); |
| 72 | 73 | $route->setHttpMethods($methods); |
| 73 | - if (count($args) > 0) |
|
| 74 | - $route->setMiddleware($args); |
|
| 74 | + if (count($args) > 0) { |
|
| 75 | + $route->setMiddleware($args); |
|
| 76 | + } |
|
| 75 | 77 | $this->routes[] = $route; |
| 76 | 78 | return $this; |
| 77 | 79 | } |
@@ -72,8 +72,9 @@ |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | public function setCallable($callback) { |
| 75 | - if (is_callable($callback)) |
|
| 76 | - $this->callable = $callback; |
|
| 75 | + if (is_callable($callback)) { |
|
| 76 | + $this->callable = $callback; |
|
| 77 | + } |
|
| 77 | 78 | } |
| 78 | 79 | |
| 79 | 80 | /** |