Passed
Push — main ( aea47e...7f34fc )
by Roberto
12:44
created
src/Core/Handler/StaticHandler.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
     }
51 51
 
52 52
     public function handle($match): FileResponse|NotFoundResponse{
53
-      if($match instanceof Match404){
53
+      if($match instanceof Match404) {
54 54
         return new NotFoundResponse();
55 55
       }
56 56
       return new FileResponse($match->filePath, $match->contentType);
Please login to merge, or discard this patch.
src/Core/Handler/BaseHandler.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
               $middlewareInstance->addMatcher($matcher);
61 61
               $middlewareInstance->setRequest($this->request);
62 62
               $middlewareResult = $middlewareInstance(...$args);
63
-              if($middlewareResult instanceof HttpResponse){
63
+              if($middlewareResult instanceof HttpResponse) {
64 64
                 return $middlewareResult;
65 65
               }
66 66
             }
Please login to merge, or discard this patch.
src/Http/Response/RedirectResponse.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
         } else {
22 22
             $headers = [ "Location" => $parsedUrl ];
23 23
         }
24
-        if(isset($redirect_after)){
24
+        if(isset($redirect_after)) {
25 25
             $_SESSION["redirect_url"] = $redirect_after;
26 26
 
27 27
         }
Please login to merge, or discard this patch.
src/Middleware/BaseAccessControlMiddleware.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
 
38 38
     protected function checkPermissions(string $modifier, mixed ...$params):bool{
39
-        if($modifier == LoginRequired::class){
39
+        if($modifier == LoginRequired::class) {
40 40
             $authenticator = new \Lepton\Authenticator\UserAuthenticator();
41 41
             return $authenticator->isLoggedIn();
42 42
         }
Please login to merge, or discard this patch.
src/Boson/QuerySet.php 1 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/Controller/BaseController.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
         $template  = new Template($path);
22 22
         $template->registerFilter(new SiteFilter());
23 23
 
24
-        if(isset($this->custom_filters)){
24
+        if(isset($this->custom_filters)) {
25 25
             foreach($this->custom_filters as $filter){
26 26
                 $template->registerFilter(new $filter());
27 27
             }
Please login to merge, or discard this patch.
src/Middleware/RBACMiddleware.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
             $user = $authenticator->getLoggedUser();
50 50
             $num_privileges = $user->privileges->and(livello__gte: $level)->count();
51 51
             return ($num_privileges > 0);
52
-        } elseif($modifier == PermissionRequired::class){
52
+        } elseif($modifier == PermissionRequired::class) {
53 53
             $user = (new UserAuthenticator)->getLoggedUser();
54 54
             die(print_r($params));
55 55
         }
Please login to merge, or discard this patch.
src/Authenticator/UserAuthenticator.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
                 $user->$hashField = $session_hash;
50 50
                 $user->save();
51 51
             }
52
-            if(isset($this->config->access_field)){
52
+            if(isset($this->config->access_field)) {
53 53
                 $accessField = $this->config->access_field;
54 54
                 date_default_timezone_set('Europe/Rome');
55 55
                 $user->$accessField = date('Y-m-d H:i:s', time());;
@@ -72,7 +72,8 @@  discard block
 block discarded – undo
72 72
         $user = $this->getUserById($user_id);
73 73
 
74 74
         //$hashField = $this->config->hash_field;
75
-        if (!$user) {// || $user->$hashField !== $_SESSION['session_hash']) {
75
+        if (!$user) {
76
+// || $user->$hashField !== $_SESSION['session_hash']) {
76 77
             return false;
77 78
         }
78 79
 
Please login to merge, or discard this patch.