Passed
Push — master ( 8507f0...24256b )
by Henri
01:40
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
@@ -44,20 +44,20 @@  discard block
 block discarded – undo
44 44
     {
45 45
         $this->lastReturn = null;
46 46
         
47
-		$url = (substr($url,0,1) !=='/' and strlen($url) > 0) ? "/{$url}" : $url;
47
+        $url = (substr($url,0,1) !=='/' and strlen($url) > 0) ? "/{$url}" : $url;
48 48
 
49
-    	foreach($this->routers as $key => $value){
50
-    		if( md5($this->prefix . $value['url'] . $value['protocol'] ) === md5( $url . $protocol ) ){
49
+        foreach($this->routers as $key => $value){
50
+            if( md5($this->prefix . $value['url'] . $value['protocol'] ) === md5( $url . $protocol ) ){
51 51
                 throw new Exception("There is already a route with the url {$url} and with the {$protocol} protocol configured.");
52 52
             }
53 53
         }
54 54
         
55 55
         $this->checkTypeRole($walking);
56 56
 
57
-		$route = [
58
-			'url' => $this->prefix.$url,
59
-			'role' => $walking,
60
-			'protocol' => $protocol,
57
+        $route = [
58
+            'url' => $this->prefix.$url,
59
+            'role' => $walking,
60
+            'protocol' => $protocol,
61 61
             'filters' => null,
62 62
             'where' => null,
63 63
             'before' => null,
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
             'after' => null,
66 66
             'afterAll' => $this->afterAll,
67 67
             'group' => self::getInstance()->group
68
-		];
68
+        ];
69 69
 
70
-		$this->routers[] = $route;		
70
+        $this->routers[] = $route;		
71 71
         
72 72
         return self::getInstance();
73 73
     }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 
146 146
         $instance->getInstance()->byName($routeName);
147 147
 
148
-		$currentProtocol = $instance->getInstance()->getProtocol();
148
+        $currentProtocol = $instance->getInstance()->getProtocol();
149 149
 
150 150
         foreach(array_reverse($instance->getInstance()->routers) as $r => $route){
151 151
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         
179 179
         $instance->getInstance()->currentRoute = null;
180 180
 
181
-	    throw new Exception('Page not found.',404);
181
+        throw new Exception('Page not found.',404);
182 182
     }
183 183
 
184 184
     public 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
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.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
         if( ($this->getProtocol() == 'form') ){
79 79
             $this->ControllerForm($controller, $method, $data['POST']);
80
-        }else {
80
+        } else {
81 81
             $data = (array_key_exists('data',$data['POST'])) ? json_decode($data['POST']['data'], true) : $data['GET'];
82 82
             call_user_func_array([$controller,$method],  $data);
83 83
         }
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         if($route[$state] !== null){
124 124
             if(is_string($route[$state])){
125 125
                 $this->Controller($route[$state]);
126
-            }else{
126
+            } else{
127 127
                 $route[$state]();
128 128
             }
129 129
         }
Please login to merge, or discard this patch.