Completed
Push — master ( 39dce4...f4117b )
by Anderson
01:57
created
src/Core/Route.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -570,12 +570,12 @@  discard block
 block discarded – undo
570 570
 
571 571
             foreach ($replaces as $regex => $replace)
572 572
             {
573
-                if($customRegex)
573
+                if ($customRegex)
574 574
                     continue;
575 575
 
576 576
                 $matches = [];
577 577
 
578
-                if(preg_match('/^\{(.*)\}$/', $segment))
578
+                if (preg_match('/^\{(.*)\}$/', $segment))
579 579
                 {
580 580
                     $foundedArgs[$key] = $segment;
581 581
                 }
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
                 $c = 0;
584 584
                 $segment = preg_replace('/'.$regex.'/', $replace, $segment, 1, $c);
585 585
 
586
-                if( $regex == array_keys($replaces)[0] && $c > 0)
586
+                if ($regex == array_keys($replaces)[0] && $c > 0)
587 587
                     $customRegex = TRUE;
588 588
             }
589 589
         }
@@ -809,11 +809,11 @@  discard block
 block discarded – undo
809 809
         array_pop(self::$prefix);
810 810
         array_pop(self::$hideOriginals);
811 811
 
812
-        if( isset($attr['namespace']) )
812
+        if (isset($attr['namespace']))
813 813
             array_pop(self::$namespace);
814 814
 
815 815
         // Flushing nested middleware:
816
-        for($i = 0; $i < $mcount; $i++)
816
+        for ($i = 0; $i < $mcount; $i++)
817 817
             array_pop(self::$middleware);
818 818
     }
819 819
 
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
                             {
1034 1034
                                 for ($i = 0; $i < $c_e_findPath; $i++)
1035 1035
                                 {
1036
-                                    if(in_array($i, $skip_seg))
1036
+                                    if (in_array($i, $skip_seg))
1037 1037
                                         continue;
1038 1038
 
1039 1039
                                     if ($valid)
Please login to merge, or discard this patch.
src/Middleware/Request.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             if (ENVIRONMENT != 'production')
96 96
                 show_error('The request method '.$this->requestMethod.' is not allowed to view the resource', 403, 'Forbidden method');
97 97
 
98
-            if(is_null(Route::get404()))
98
+            if (is_null(Route::get404()))
99 99
                 show_404();
100 100
 
101 101
             if (Route::get404()->controller != get_class($this->CI))
@@ -110,16 +110,16 @@  discard block
 block discarded – undo
110 110
 
111 111
                 // Redirect to 404 if not enough parameters provided
112 112
 
113
-                if(count($path_args) < count($route_args['required']))
113
+                if (count($path_args) < count($route_args['required']))
114 114
                     redirect(Route::get404()->path);
115 115
 
116
-                if(count($path_args) == 0)
116
+                if (count($path_args) == 0)
117 117
                 {
118 118
                     $this->CI->{$this->route->method}();
119 119
                 }
120 120
                 else
121 121
                 {
122
-                    call_user_func_array( [$this->CI, $this->route->method], array_values($path_args) );
122
+                    call_user_func_array([$this->CI, $this->route->method], array_values($path_args));
123 123
                 }
124 124
 
125 125
                 // TODO: Add support to hooks in this execution thread
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                 if (ENVIRONMENT != 'production')
133 133
                     show_error('The method '.$this->route->controller.'::'.$this->route->method.'() does not exists', 500, 'Method not found');
134 134
 
135
-                if(is_null(Route::get404()))
135
+                if (is_null(Route::get404()))
136 136
                     show_404();
137 137
 
138 138
                 if (Route::get404()->controller != get_class($this->CI))
Please login to merge, or discard this patch.