Passed
Branch master (df8076)
by Henri
03:18 queued 01:41
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   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
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
-    	$this->checkExistence($url,$protocol);
48
+        $this->checkExistence($url,$protocol);
49 49
         $this->checkTypeRole($walking);
50 50
 
51
-		$route = [
52
-			'url' => $this->prefix.$url,
53
-			'role' => $walking,
54
-			'protocol' => $protocol,
51
+        $route = [
52
+            'url' => $this->prefix.$url,
53
+            'role' => $walking,
54
+            'protocol' => $protocol,
55 55
             'filters' => null,
56 56
             'where' => null,
57 57
             'before' => null,
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
             'after' => null,
60 60
             'afterAll' => $this->afterAll,
61 61
             'group' => self::getInstance()->group
62
-		];
62
+        ];
63 63
 
64
-		$this->routers[] = $route;		
64
+        $this->routers[] = $route;		
65 65
         
66 66
         return self::getInstance();
67 67
     }
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   +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.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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)
Please login to merge, or discard this patch.
src/CheckTrait.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.