Passed
Push — master ( f29cb9...fb1aeb )
by Henri
01:21
created
src/Router.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -217,7 +217,7 @@
 block discarded – undo
217 217
             foreach ($route['filters'] as $key => $value) {
218 218
                 $filters[] = $value;
219 219
             }
220
-        }else{
220
+        } else{
221 221
             $filters[] = $route['filters'];
222 222
         }
223 223
 
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -71,26 +71,26 @@  discard block
 block discarded – undo
71 71
 
72 72
     public function set($url ,$walking , string $protocol): Router
73 73
     {
74
-		$url = (substr($url,0,1) !=='/' and strlen($url) > 0) ? "/{$url}" : $url;
74
+        $url = (substr($url,0,1) !=='/' and strlen($url) > 0) ? "/{$url}" : $url;
75 75
 
76
-    	foreach($this->routers as $key => $value){
77
-    		if( md5($this->prefix . $value['url'] . $value['protocol'] ) === md5( $url . $protocol ) ){
76
+        foreach($this->routers as $key => $value){
77
+            if( md5($this->prefix . $value['url'] . $value['protocol'] ) === md5( $url . $protocol ) ){
78 78
                 throw new Exception("There is already a route with the url {$url} and with the {$protocol} protocol configured.");
79 79
             }
80 80
         }
81 81
         
82 82
         $this->checkTypeRole($walking);
83 83
 
84
-		$route = [
85
-			'url' => $this->prefix.$url,
86
-			'role' => $walking,
87
-			'protocol' => $protocol,
84
+        $route = [
85
+            'url' => $this->prefix.$url,
86
+            'role' => $walking,
87
+            'protocol' => $protocol,
88 88
             'filters' => null,
89 89
             'where' => null,
90 90
             'group' => self::getInstance()->group
91
-		];
91
+        ];
92 92
 
93
-		$this->routers[] = $route;		
93
+        $this->routers[] = $route;		
94 94
         
95 95
         return self::getInstance();
96 96
     }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
         $instance->getInstance()->byName($routeName);
168 168
 
169
-		$currentProtocol = $instance->getInstance()->getProtocol();
169
+        $currentProtocol = $instance->getInstance()->getProtocol();
170 170
 
171 171
         foreach(array_reverse($instance->getInstance()->routers) as $r => $route){
172 172
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
         
198 198
         $instance->getInstance()->currentRoute = null;
199 199
 
200
-	    throw new Exception('Page not found.',404);
200
+        throw new Exception('Page not found.',404);
201 201
     }
202 202
 
203 203
     public static function filter($filters): Router
Please login to merge, or discard this patch.
examples/index.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
     /* Return current action route */
21 21
     $action = Router::currentRouteAction();
22 22
 
23
-}catch(Exception $er){
23
+} catch(Exception $er){
24 24
 
25 25
     die("Code Error: {$er->getCode()}, Line: {$er->getLine()}, File: {$er->getFile()}, Message: {$er->getMessage()}.");
26 26
 
Please login to merge, or discard this patch.
src/Helper.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 
61 61
         if( ($this->getProtocol() == 'form') ){
62 62
             $this->ControllerForm($controller, $method, $data['POST']);
63
-        }else {
63
+        } else {
64 64
             $data = (array_key_exists('data',$data['POST'])) ? json_decode($data['POST']['data'], true) : $data['GET'];
65 65
             call_user_func_array([$controller,$method],  $data);
66 66
         }
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
     }
51 51
 
52 52
     protected function ControllerForm($controller, string $method, array $values){
53
-		$this->checkRole();
53
+        $this->checkRole();
54 54
         $method = ($method !== 'method') ? $method : $this->getData()['POST']['role'];
55 55
         $data = (array_key_exists('data',$values)) ? json_decode($values['data'], true) : null;
56 56
 
Please login to merge, or discard this patch.