Passed
Push — main ( bae336...1e821c )
by Roberto
01:48
created
src/Boson/DataTypes/PrimaryKey.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,9 @@
 block discarded – undo
8 8
   }
9 9
 
10 10
   public function validate($value){
11
-    if(is_null($value) && (!$this->null)) return false;
11
+    if(is_null($value) && (!$this->null)) {
12
+        return false;
13
+    }
12 14
     return true;
13 15
   }
14 16
 }
15 17
\ No newline at end of file
Please login to merge, or discard this patch.
src/Boson/DataTypes/TextField.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,12 @@
 block discarded – undo
15 15
 
16 16
   public function validate($value){
17 17
     return true;
18
-    if(is_null($value) && (!$this->nullable)) return false;
19
-    if(strlen($value) > $this->max_length) return false;
18
+    if(is_null($value) && (!$this->nullable)) {
19
+        return false;
20
+    }
21
+    if(strlen($value) > $this->max_length) {
22
+        return false;
23
+    }
20 24
     return true;
21 25
   }
22 26
 }
23 27
\ No newline at end of file
Please login to merge, or discard this patch.
src/Boson/DataTypes/CharField.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,12 @@
 block discarded – undo
12 12
 
13 13
     public function validate($value)
14 14
     {
15
-        if(is_null($value) && (!$this->null)) return false;
16
-        if(strlen($value) > $this->max_length) return false;
15
+        if(is_null($value) && (!$this->null)) {
16
+            return false;
17
+        }
18
+        if(strlen($value) > $this->max_length) {
19
+            return false;
20
+        }
17 21
         return true;
18 22
     }
19 23
 }
Please login to merge, or discard this patch.
src/Boson/DataTypes/NumberField.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,9 @@
 block discarded – undo
8 8
   }
9 9
 
10 10
   public function validate($value){
11
-    if(is_null($value) && (!$this->null)) return false;
11
+    if(is_null($value) && (!$this->null)) {
12
+        return false;
13
+    }
12 14
     return true;
13 15
   }
14 16
 }
15 17
\ No newline at end of file
Please login to merge, or discard this patch.
src/Authenticator/UserAuthenticator.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,8 @@
 block discarded – undo
67 67
         $user = $this->getUserById($user_id);
68 68
 
69 69
         //$hashField = $this->config->hash_field;
70
-        if (!$user) {// || $user->$hashField !== $_SESSION['session_hash']) {
70
+        if (!$user) {
71
+// || $user->$hashField !== $_SESSION['session_hash']) {
71 72
             return false;
72 73
         }
73 74
 
Please login to merge, or discard this patch.
src/Core/Database.php 1 patch
Braces   +14 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@  discard block
 block discarded – undo
17 17
 	}
18 18
 
19 19
   public function query($query, &...$args) {
20
-    if(!$this->query_closed){
20
+    if(!$this->query_closed) {
21 21
       $this->query_closed = TRUE;
22 22
       $this->query->close();
23 23
     }
24 24
 		if ($this->query = $this->connection->prepare($query)) {
25
-      if(count($args)){
25
+      if(count($args)) {
26 26
         $types = implode(array_map(array($this, '_gettype'), $args));
27 27
         $this->query->bind_param($types, ...$args);
28 28
       }
@@ -56,7 +56,9 @@  discard block
 block discarded – undo
56 56
       }
57 57
       if ($callback != null && is_callable($callback)) {
58 58
         $value = $callback($r);//call_user_func($callback, $r);
59
-        if ($value == 'break') break;
59
+        if ($value == 'break') {
60
+            break;
61
+        }
60 62
       } else {
61 63
         $result[] = $r;
62 64
       }
@@ -113,9 +115,15 @@  discard block
 block discarded – undo
113 115
   }
114 116
 
115 117
 	private function _gettype($var) {
116
-	    if (is_string($var)) return 's';
117
-	    if (is_float($var)) return 'd';
118
-	    if (is_int($var)) return 'i';
118
+	    if (is_string($var)) {
119
+	        return 's';
120
+	    }
121
+	    if (is_float($var)) {
122
+	        return 'd';
123
+	    }
124
+	    if (is_int($var)) {
125
+	        return 'i';
126
+	    }
119 127
 	    return 'b';
120 128
 	}
121 129
 
Please login to merge, or discard this patch.
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.