@@ -95,7 +95,7 @@ |
||
| 95 | 95 | protected function checkExistence(string $url, string $protocol) |
| 96 | 96 | { |
| 97 | 97 | foreach($this->routers as $key => $value){ |
| 98 | - if( md5($this->prefix . $value['url'] . $value['protocol'] ) === md5( $url . $protocol ) ){ |
|
| 98 | + if( md5($this->prefix . $value['url'] . $value['protocol'] ) === md5( $url . $protocol ) ){ |
|
| 99 | 99 | throw new Exception("There is already a route with the url {$url} and with the {$protocol} protocol configured."); |
| 100 | 100 | } |
| 101 | 101 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | protected function ControllerForm($controller, string $method, array $values) |
| 47 | 47 | { |
| 48 | - $this->checkRole(); |
|
| 48 | + $this->checkRole(); |
|
| 49 | 49 | $method = ($method !== 'method') ? $method : $this->getData()['POST']['role']; |
| 50 | 50 | $data = (array_key_exists('data',$values)) ? json_decode($values['data'], true) : []; |
| 51 | 51 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | $this->currentRoute = null; |
| 157 | - throw new Exception('Page not found.',404); |
|
| 157 | + throw new Exception('Page not found.',404); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | protected function loadByName(string $routName) |
@@ -48,15 +48,15 @@ discard block |
||
| 48 | 48 | { |
| 49 | 49 | $this->lastReturn = null; |
| 50 | 50 | |
| 51 | - $url = (substr($url,0,1) !=='/' and strlen($url) > 0) ? "/{$url}" : $url; |
|
| 51 | + $url = (substr($url,0,1) !=='/' and strlen($url) > 0) ? "/{$url}" : $url; |
|
| 52 | 52 | |
| 53 | - $this->checkExistence($url,$protocol); |
|
| 53 | + $this->checkExistence($url,$protocol); |
|
| 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 | 'middlewares' => 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 | } |