@@ -43,20 +43,20 @@ discard block |
||
43 | 43 | { |
44 | 44 | $this->lastReturn = null; |
45 | 45 | |
46 | - $url = (substr($url,0,1) !=='/' and strlen($url) > 0) ? "/{$url}" : $url; |
|
46 | + $url = (substr($url,0,1) !=='/' and strlen($url) > 0) ? "/{$url}" : $url; |
|
47 | 47 | |
48 | - foreach($this->routers as $key => $value){ |
|
49 | - if( md5($this->prefix . $value['url'] . $value['protocol'] ) === md5( $url . $protocol ) ){ |
|
48 | + foreach($this->routers as $key => $value){ |
|
49 | + if( md5($this->prefix . $value['url'] . $value['protocol'] ) === md5( $url . $protocol ) ){ |
|
50 | 50 | throw new Exception("There is already a route with the url {$url} and with the {$protocol} protocol configured."); |
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | 54 | $this->checkTypeRole($walking); |
55 | 55 | |
56 | - $route = [ |
|
57 | - 'url' => $this->prefix.$url, |
|
58 | - 'role' => $walking, |
|
59 | - 'protocol' => $protocol, |
|
56 | + $route = [ |
|
57 | + 'url' => $this->prefix.$url, |
|
58 | + 'role' => $walking, |
|
59 | + 'protocol' => $protocol, |
|
60 | 60 | 'filters' => null, |
61 | 61 | 'where' => null, |
62 | 62 | 'before' => null, |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | 'after' => null, |
65 | 65 | 'afterAll' => $this->afterAll, |
66 | 66 | 'group' => self::getInstance()->group |
67 | - ]; |
|
67 | + ]; |
|
68 | 68 | |
69 | - $this->routers[] = $route; |
|
69 | + $this->routers[] = $route; |
|
70 | 70 | |
71 | 71 | return self::getInstance(); |
72 | 72 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | return $instance; |
149 | 149 | } |
150 | 150 | |
151 | - $currentProtocol = $instance->getProtocol(); |
|
151 | + $currentProtocol = $instance->getProtocol(); |
|
152 | 152 | |
153 | 153 | foreach(array_reverse($instance->routers) as $r => $route){ |
154 | 154 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | $instance->currentRoute = null; |
181 | - throw new Exception('Page not found.',404); |
|
181 | + throw new Exception('Page not found.',404); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | public static function dispatch(?string $routeName = null): bool |