Passed
Push — master ( 18e951...67611c )
by Henri
01:38
created
examples/Middleware/Lasted.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
 use Psr\Http\Server\RequestHandlerInterface;
9 9
 
10 10
 /** 
11
-  * @property string $error
12
-  */ 
11
+ * @property string $error
12
+ */ 
13 13
 class Lasted extends Middleware{
14 14
 
15 15
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
Please login to merge, or discard this patch.
examples/Middleware/Auth.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@
 block discarded – undo
7 7
 use Psr\Http\Server\RequestHandlerInterface;
8 8
 
9 9
 /** 
10
-  * @property string $error
11
-  */ 
10
+ * @property string $error
11
+ */ 
12 12
 class Auth extends Middleware{
13 13
 
14 14
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
Please login to merge, or discard this patch.
examples/MiddlewareExample.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
 
78 78
     runMiddlewares($serverRequest);
79 79
 
80
-}catch(Exception $er){
80
+} catch(Exception $er){
81 81
 
82 82
     die("Code Error: {$er->getCode()}<br>Line: {$er->getLine()}<br>File: {$er->getFile()}<br>Message: {$er->getMessage()}.");
83 83
 
Please login to merge, or discard this patch.
examples/DefaultUseExample.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
      */ 
29 29
     $action = Router::currentAction();
30 30
 
31
-}catch(Exception $er){
31
+} catch(Exception $er){
32 32
 
33 33
     die("Code Error: {$er->getCode()}<br>Line: {$er->getLine()}<br>File: {$er->getFile()}<br>Message: {$er->getMessage()}.");
34 34
 
Please login to merge, or discard this patch.
src/Router.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                 self::getInstance()->checkMethod($route, $requestMethod);
71 71
                 self::getInstance()->checkData($route, (new Uri($_SERVER['REQUEST_URI']))->getPath());
72 72
                 return self::getInstance();
73
-            }catch(\Exception $er){
73
+            } catch(\Exception $er){
74 74
                 continue;
75 75
             }
76 76
         }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         try{
98 98
             $action = unserialize(self::getInstance()->current()['action']);
99 99
             self::getInstance()->executeRouteAction( (is_string($action)) ? $action : $action->getClosure()  );
100
-        }catch(\Exception $er){
100
+        } catch(\Exception $er){
101 101
             self::getInstance()->error = $er;
102 102
         }
103 103
         
Please login to merge, or discard this patch.
src/AttributeTrait.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,9 @@  discard block
 block discarded – undo
35 35
     {
36 36
         try{
37 37
             foreach ($method->getAttributes() as $attr) {
38
-                if($attr->getName() != 'HnrAzevedo\Router\RouteAttribute') continue;
38
+                if($attr->getName() != 'HnrAzevedo\Router\RouteAttribute') {
39
+                    continue;
40
+                }
39 41
 
40 42
                 $args = $attr->getArguments();
41 43
     
@@ -54,7 +56,7 @@  discard block
 block discarded – undo
54 56
                     ->attrWhere($args)
55 57
                     ->attrMiddleware($args);
56 58
             }
57
-        }catch(Exception $er){
59
+        } catch(Exception $er){
58 60
             throw new Exception('Failed to add route via attribute: '.$er->getMessage());
59 61
         }
60 62
     }
Please login to merge, or discard this patch.
examples/AttributeExample.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */ 
36 36
     $action = Router::currentAction();
37 37
 
38
-}catch(Exception $er){
38
+} catch(Exception $er){
39 39
 
40 40
     die("Code Error: {$er->getCode()}".PHP_EOL."Line: {$er->getLine()}".PHP_EOL."File: {$er->getFile()}".PHP_EOL."Message: {$er->getMessage()}.");
41 41
 
Please login to merge, or discard this patch.
src/DefinitionsTrait.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
         }
70 70
 
71 71
         $routes[strval($index)] = [
72
-			'uri' => serialize(new Uri(self::getInstance()->getHost().self::getInstance()->getPrefix().$uri)),
73
-			'action' => (is_callable($closure)) ? serialize(new SerializableClosure($closure)) : serialize($closure),
74
-			'method' => strtoupper($method),
72
+            'uri' => serialize(new Uri(self::getInstance()->getHost().self::getInstance()->getPrefix().$uri)),
73
+            'action' => (is_callable($closure)) ? serialize(new SerializableClosure($closure)) : serialize($closure),
74
+            'method' => strtoupper($method),
75 75
             'middlewares' => [],
76 76
             'where' => [],
77 77
             'before' => [],
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     private static function checkDuplicity(string $uri, string $method): void
91 91
     {
92 92
         foreach(self::getInstance()->getRoutes() as $route){
93
-    		if( md5(strtoupper(unserialize($route['uri'])->getPath().$route['method'])) === md5(strtoupper($uri.$method)) ){
93
+            if( md5(strtoupper(unserialize($route['uri'])->getPath().$route['method'])) === md5(strtoupper($uri.$method)) ){
94 94
                 throw new \RuntimeException("There is already a route with the URI {$uri} and with the {$method} METHOD configured.");
95 95
             }
96 96
         }
Please login to merge, or discard this patch.
src/RunInTrait.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,9 @@  discard block
 block discarded – undo
91 91
             $ReflectionMethod =  new \ReflectionFunction ($closure);
92 92
 
93 93
             foreach($ReflectionMethod->getParameters() as $param){
94
-                if(!isset($_REQUEST[$param->name])) continue;
94
+                if(!isset($_REQUEST[$param->name])) {
95
+                    continue;
96
+                }
95 97
                 $params[$param->name] = $_REQUEST[$param->name];
96 98
             }
97 99
             
@@ -174,7 +176,9 @@  discard block
 block discarded – undo
174 176
         $ReflectionMethod =  new \ReflectionMethod(new $controller(), $method);
175 177
 
176 178
         foreach($ReflectionMethod->getParameters() as $param){
177
-            if(!isset($_REQUEST[$param->name])) continue;
179
+            if(!isset($_REQUEST[$param->name])) {
180
+                continue;
181
+            }
178 182
             $params[$param->name] = $_REQUEST[$param->name];
179 183
         }
180 184
 
Please login to merge, or discard this patch.