@@ -41,8 +41,6 @@ |
||
41 | 41 | |
42 | 42 | /** |
43 | 43 | * |
44 | - * @param type $pattern |
|
45 | - * @param type $args |
|
46 | 44 | * @return |
47 | 45 | */ |
48 | 46 | public function get() { |
@@ -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 | } |
@@ -141,7 +141,7 @@ |
||
141 | 141 | $args = func_get_args(); |
142 | 142 | $this->methods = array_merge($this->methods, $args); |
143 | 143 | } |
144 | - public function getParams(){ |
|
144 | + public function getParams() { |
|
145 | 145 | return $this->params; |
146 | 146 | } |
147 | 147 | public function match($uri) { |
@@ -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 | /** |
@@ -53,7 +53,7 @@ |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | public function exceptionHandler($ex) { |
56 | - $lastTrace = $ex->getTrace()[count($ex->getTrace()) -1]; |
|
56 | + $lastTrace = $ex->getTrace()[count($ex->getTrace()) - 1]; |
|
57 | 57 | $output = <<<EXC |
58 | 58 | <!DOCTYPE> |
59 | 59 | <html> |