Passed
Push — master ( ff1f1e...e434bf )
by Henri
01:17
created
src/Router.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -61,25 +61,25 @@  discard block
 block discarded – undo
61 61
 
62 62
     public function set($url ,$walking , string $protocol): Router
63 63
     {
64
-		$url = (substr($url,0,1) !=='/' and strlen($url) > 0) ? "/{$url}" : $url;
64
+        $url = (substr($url,0,1) !=='/' and strlen($url) > 0) ? "/{$url}" : $url;
65 65
 
66
-    	foreach($this->routers as $key => $value){
67
-    		if( md5($this->prefix . $value['url'] . $value['protocol'] ) === md5( $url . $protocol ) ){
66
+        foreach($this->routers as $key => $value){
67
+            if( md5($this->prefix . $value['url'] . $value['protocol'] ) === md5( $url . $protocol ) ){
68 68
                 throw new Exception("There is already a route with the url {$url} and with the {$protocol} protocol configured.");
69 69
             }
70 70
         }
71 71
         
72 72
         $this->check_typeRole($walking);
73 73
 
74
-		$route = [
75
-			'url' => $this->prefix.$url,
76
-			'role' => $walking,
77
-			'protocol' => $protocol,
78
-			'filters' => null,
74
+        $route = [
75
+            'url' => $this->prefix.$url,
76
+            'role' => $walking,
77
+            'protocol' => $protocol,
78
+            'filters' => null,
79 79
             'group' => self::getInstance()->group
80
-		];
80
+        ];
81 81
 
82
-		$this->routers[] = $route;		
82
+        $this->routers[] = $route;		
83 83
         
84 84
         return self::getInstance();
85 85
     }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     {
141 141
         $this->byName($route_name);
142 142
 
143
-		$currentProtocol = $this->getProtocol();
143
+        $currentProtocol = $this->getProtocol();
144 144
 
145 145
         foreach(array_reverse($this->routers) as $r => $route){
146 146
 
@@ -156,19 +156,19 @@  discard block
 block discarded – undo
156 156
 
157 157
             $route_request = $this->explodeRoute((substr($_SERVER['REQUEST_URI'],strlen($_SERVER['REQUEST_URI'])-1,1) === '/') , $_SERVER['REQUEST_URI']);
158 158
 
159
-	        if($this->check_numparams($route_loop, $route_request) || !$this->check_parameters($route_loop, $route_request)){
159
+            if($this->check_numparams($route_loop, $route_request) || !$this->check_parameters($route_loop, $route_request)){
160 160
                 continue;
161 161
             }
162 162
             
163 163
             $this->check_filtering($route);
164 164
 
165 165
             $this->toHiking($route['role']);
166
-	        return true;
166
+            return true;
167 167
         }
168 168
         
169 169
         unset($_SESSION['route']);
170 170
 
171
-	    throw new Exception('Page not found.',404);
171
+        throw new Exception('Page not found.',404);
172 172
     }
173 173
 
174 174
     public static function filter($filters): Router
Please login to merge, or discard this patch.