Passed
Push — main ( d81cf5...e4a1c0 )
by Roberto
12:52
created
src/Boson/QuerySet.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -81,49 +81,49 @@  discard block
 block discarded – undo
81 81
     public function __construct(protected string $model)
82 82
     {
83 83
         $this->lookup_map = array(
84
-          "equals" => [
84
+            "equals" => [
85 85
             "operator" => "=",
86 86
             "rhs" => fn ($x) =>  $x
87
-          ],
88
-          "startswith" => [
87
+            ],
88
+            "startswith" => [
89 89
             "operator" => "LIKE",
90 90
             "rhs" => fn ($x) =>  sprintf('%s%%', $x)
91
-          ],
91
+            ],
92 92
 
93
-          "endswith" => [
93
+            "endswith" => [
94 94
             "operator" => "LIKE",
95 95
             "rhs" => fn ($x) => sprintf('%%%s', $x)
96
-          ],
96
+            ],
97 97
 
98
-          "contains" => [
98
+            "contains" => [
99 99
             "operator" => "LIKE",
100 100
             "rhs" => fn ($x) => sprintf('%%%s%%', $x)
101
-          ],
101
+            ],
102 102
 
103
-          "lte" => [
103
+            "lte" => [
104 104
             "operator" => "<=",
105 105
             "rhs" => fn ($x) => $x
106
-          ],
106
+            ],
107 107
 
108
-          "gte" => [
108
+            "gte" => [
109 109
             "operator" => ">=",
110 110
             "rhs" => fn ($x) => $x
111
-          ],
111
+            ],
112 112
 
113
-          "lt" => [
113
+            "lt" => [
114 114
             "operator" => "<",
115 115
             "rhs" => fn ($x) => $x
116
-          ],
116
+            ],
117 117
 
118
-          "gt" => [
118
+            "gt" => [
119 119
             "operator" => ">",
120 120
             "rhs" => fn ($x) => $x
121
-          ],
121
+            ],
122 122
 
123
-          "neq" => [
123
+            "neq" => [
124 124
             "operator" => "<>",
125 125
             "rhs" => fn ($x) => $x
126
-          ]
126
+            ]
127 127
         );
128 128
 
129 129
         $this->filters = array();
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
             $query .= sprintf(" ORDER BY %s", $modifiers);
494 494
         }
495 495
 
496
-       //if(strpos($query, "ORDER BY")) die (print_r($query));
496
+        //if(strpos($query, "ORDER BY")) die (print_r($query));
497 497
         return array($query, $values);
498 498
     }
499 499
 
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
                 }
569 569
             }, $modifiers, array_keys($modifiers))
570 570
         );*/
571
-      }
571
+        }
572 572
 
573 573
 
574 574
     private function buildWhereClause($filters)
@@ -674,9 +674,9 @@  discard block
 block discarded – undo
674 674
         }
675 675
 
676 676
         return array(
677
-          "column"    => $last->getColumnFromField($column),
678
-          "condition" => $condition,
679
-          "join" => $join
677
+            "column"    => $last->getColumnFromField($column),
678
+            "condition" => $condition,
679
+            "join" => $join
680 680
         );
681 681
     }
682 682
 }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -414,11 +414,13 @@  discard block
 block discarded – undo
414 414
      *  @return QuerySet
415 415
      */
416 416
 
417
-    public function do(): QuerySet
417
+    public function do {
418
+        (): QuerySet
418 419
     {
419 420
 
420 421
         // Build the query
421 422
         list($query, $values) = $this->buildQuery();
423
+    }
422 424
 
423 425
         // Connect to DB
424 426
         $db = Application::getDb();
@@ -484,7 +486,7 @@  discard block
 block discarded – undo
484 486
         $query .= " ".$this->buildJoin($join);
485 487
         $query .= " ".$this->buildJoin($join_t);
486 488
 
487
-        if(count($this->filters)>0){
489
+        if(count($this->filters)>0) {
488 490
             $query .= sprintf(" WHERE %s ", $whereClause);
489 491
         }
490 492
 
Please login to merge, or discard this patch.
src/LeptonServer.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,8 @@
 block discarded – undo
83 83
                             // if it's a main file
84 84
                             if(key_exists($file, $this->dependancyTree)) {
85 85
                                 $this->dependancyTree[$file] = $this->compileFile($file);
86
-                            } else { // if it's an included file
86
+                            } else {
87
+// if it's an included file
87 88
                                 foreach($this->dependancyTree as $main => $dependancies) {
88 89
                                     if(in_array($file, $dependancies)) {
89 90
                                         $this->dependancyTree[$main] = $this->compileFile($main);
Please login to merge, or discard this patch.
src/Core/Handler/BaseHandler.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -58,13 +58,13 @@
 block discarded – undo
58 58
         if($matcher instanceof MatchRoute) {
59 59
 
60 60
             foreach($this->middlewares as $middleware => $args){
61
-              $middlewareInstance = new $middleware();
62
-              $middlewareInstance->addMatcher($matcher);
63
-              $middlewareInstance->setRequest($this->request);
64
-              $middlewareResult = $middlewareInstance(...$args);
65
-              if($middlewareResult instanceof HttpResponse){
61
+                $middlewareInstance = new $middleware();
62
+                $middlewareInstance->addMatcher($matcher);
63
+                $middlewareInstance->setRequest($this->request);
64
+                $middlewareResult = $middlewareInstance(...$args);
65
+                if($middlewareResult instanceof HttpResponse){
66 66
                 return $middlewareResult;
67
-              }
67
+                }
68 68
             }
69 69
 
70 70
             Application::$controller = $matcher->controller;
Please login to merge, or discard this patch.
src/Core/Handler/StaticHandler.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,14 +52,14 @@
 block discarded – undo
52 52
             return new MatchFile(filePath: $filePath, contentType: $contentType);
53 53
         } else {
54 54
             die($filePath);
55
-          return new Match404();
55
+            return new Match404();
56 56
         }
57 57
     }
58 58
 
59 59
     public function handle($match): FileResponse|NotFoundResponse{
60
-      if($match instanceof Match404){
60
+        if($match instanceof Match404){
61 61
         return new NotFoundResponse();
62
-      }
63
-      return new FileResponse($match->filePath, $match->contentType);
62
+        }
63
+        return new FileResponse($match->filePath, $match->contentType);
64 64
     }
65 65
 }
Please login to merge, or discard this patch.