Test Failed
Branch main (c2f646)
by Pranjal
13:07
created
src/functions.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -51,17 +51,17 @@
 block discarded – undo
51 51
      */
52 52
     function env(string $key):mixed
53 53
     {
54
-         if (isset($_ENV[$key])) {
54
+            if (isset($_ENV[$key])) {
55 55
             return $_ENV[$key];
56
-         }
57
-         if(getenv($key)){
56
+            }
57
+            if(getenv($key)){
58 58
             return getenv($key);
59
-         }
59
+            }
60 60
        
61
-         if(request()->server->has($key)){
61
+            if(request()->server->has($key)){
62 62
             return request()->server->get($key);
63
-         }
63
+            }
64 64
 
65
-         return null;
65
+            return null;
66 66
     }
67 67
 }
Please login to merge, or discard this patch.
src/Pipeline.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -69,15 +69,15 @@
 block discarded – undo
69 69
         $refFunction = new \ReflectionFunction($middleware);
70 70
         $parameters = $refFunction->getParameters();
71 71
         foreach ($parameters as $parameter) {
72
-           if($parameter->getName() == 'request' && $parameter->getType() != 'Scrawler\Http\Request') {
73
-               throw new \Scrawler\Exception\InvalidMiddlewareException('First parameter of middleware must be of type Scrawler\Http\Request');
74
-           } 
75
-           if($parameter->getName() == 'next' && $parameter->getType() != 'Closure') {
76
-               throw new \Scrawler\Exception\InvalidMiddlewareException('Second parameter of middleware must be of type Closure');
77
-           }
78
-           if($parameter->getName() != 'request' && $parameter->getName() != 'next' ) {
79
-                 throw new \Scrawler\Exception\InvalidMiddlewareException('Invalid parameter name in middleware');
80
-           }
72
+            if($parameter->getName() == 'request' && $parameter->getType() != 'Scrawler\Http\Request') {
73
+                throw new \Scrawler\Exception\InvalidMiddlewareException('First parameter of middleware must be of type Scrawler\Http\Request');
74
+            } 
75
+            if($parameter->getName() == 'next' && $parameter->getType() != 'Closure') {
76
+                throw new \Scrawler\Exception\InvalidMiddlewareException('Second parameter of middleware must be of type Closure');
77
+            }
78
+            if($parameter->getName() != 'request' && $parameter->getName() != 'next' ) {
79
+                    throw new \Scrawler\Exception\InvalidMiddlewareException('Invalid parameter name in middleware');
80
+            }
81 81
         }
82 82
     }
83 83
 
Please login to merge, or discard this patch.
src/Traits/Container.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@
 block discarded – undo
45 45
         return $this->container->make($class, $params);
46 46
     }
47 47
 
48
-     /**
49
-     * Check if a class is registered in the container
50
-     * @param string $class
51
-     * @return bool
52
-     */
48
+        /**
49
+         * Check if a class is registered in the container
50
+         * @param string $class
51
+         * @return bool
52
+         */
53 53
     public function has(string $class): bool
54 54
     {
55 55
         return $this->container->has($class);
Please login to merge, or discard this patch.
src/Traits/Router.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -3,21 +3,21 @@
 block discarded – undo
3 3
 
4 4
 trait Router
5 5
 {
6
-     /**
7
-     * Register controller directory and namespace for autorouting
8
-     * @param string $dir 
9
-     * @param string $namespace
10
-     */
6
+        /**
7
+         * Register controller directory and namespace for autorouting
8
+         * @param string $dir 
9
+         * @param string $namespace
10
+         */
11 11
     public function registerAutoRoute(string $dir, string $namespace): void
12 12
     {
13 13
         $this->router->register($dir, $namespace);
14 14
     }
15 15
 
16
-     /**
17
-     * Register a new get route with the router
18
-     * @param string $route
19
-     * @param \Closure|callable $callback
20
-     */
16
+        /**
17
+         * Register a new get route with the router
18
+         * @param string $route
19
+         * @param \Closure|callable $callback
20
+         */
21 21
     public function get(string $route, \Closure|callable $callback): void
22 22
     {
23 23
         if(is_callable($callback)){
Please login to merge, or discard this patch.