Passed
Push — main ( b29b0b...aea47e )
by Roberto
12:37
created
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.
src/Boson/Model.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
                 $this->$property = $value;
338 338
             }
339 339
         } elseif (array_key_exists($property, $this->foreignKeys)) {
340
-            if(is_null($value)){
340
+            if(is_null($value)) {
341 341
                 $this->$property = $value;
342 342
                 $this->editedFields[] = $property;
343 343
                 $this->editedFields = array_unique($this->editedFields);
@@ -595,7 +595,9 @@  discard block
 block discarded – undo
595 595
         if (array_key_exists($field, $this->fields)) {
596 596
             return $this->$field;
597 597
         } elseif (array_key_exists($field, $this->foreignKeys)) {
598
-            if(is_null($this->$field)) return NULL;
598
+            if(is_null($this->$field)) {
599
+                return NULL;
600
+            }
599 601
             return ($this->$field)->getPk();
600 602
         }
601 603
     }
Please login to merge, or discard this patch.
src/Boson/DataTypes/CharField.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@
 block discarded – undo
12 12
 
13 13
     public function validate($value)
14 14
     {
15
-        if(strlen($value) > $this->max_length) return false;
15
+        if(strlen($value) > $this->max_length) {
16
+            return false;
17
+        }
16 18
         return parent::validate($value);
17 19
     }
18 20
 }
Please login to merge, or discard this patch.
src/Boson/DataTypes/Field.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,10 +34,18 @@  discard block
 block discarded – undo
34 34
 
35 35
 
36 36
   protected function validate($value){
37
-    if (is_null($value) && (!$this->null)) return false;
38
-    if (empty($value) && (!$this->blank)) return false;
39
-    if (!empty($this->choices) && !in_array($value, $this->choices)) return false;
40
-    if (!empty($this->validators)) return $this->validate_with_validators($value);
37
+    if (is_null($value) && (!$this->null)) {
38
+        return false;
39
+    }
40
+    if (empty($value) && (!$this->blank)) {
41
+        return false;
42
+    }
43
+    if (!empty($this->choices) && !in_array($value, $this->choices)) {
44
+        return false;
45
+    }
46
+    if (!empty($this->validators)) {
47
+        return $this->validate_with_validators($value);
48
+    }
41 49
 
42 50
     return true;
43 51
   }
@@ -45,7 +53,9 @@  discard block
 block discarded – undo
45 53
 
46 54
   private function validate_with_validators($value){
47 55
     foreach($this->validators as $validator){
48
-      if (!$validator($value)) return false;
56
+      if (!$validator($value)) {
57
+          return false;
58
+      }
49 59
     }
50 60
     return true;
51 61
   }
Please login to merge, or discard this patch.
src/Boson/DataTypes/TextField.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@
 block discarded – undo
12 12
   }
13 13
 
14 14
   public function validate($value){
15
-    if(strlen($value) > $this->max_length) return false;
15
+    if(strlen($value) > $this->max_length) {
16
+        return false;
17
+    }
16 18
     return parent::validate($value);
17 19
   }
18 20
 }
19 21
\ No newline at end of file
Please login to merge, or discard this patch.
src/Boson/DataTypes/ManyToMany.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,9 @@
 block discarded – undo
14 14
 
15 15
     public function validate($value)
16 16
     {
17
-        if (!is_a($value, $this->child)) return false;
17
+        if (!is_a($value, $this->child)) {
18
+            return false;
19
+        }
18 20
         return parent::validate($value);
19 21
     }
20 22
 }
Please login to merge, or discard this patch.
src/Boson/DataTypes/DateField.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 (!preg_match("/\d{4}-\d{2}-\d{2}/", $value)) return false;
11
+    if (!preg_match("/\d{4}-\d{2}-\d{2}/", $value)) {
12
+        return false;
13
+    }
12 14
     return parent::validate($value);
13 15
   }
14 16
 
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_numeric($value)) return false;
11
+    if(!is_numeric($value)) {
12
+        return false;
13
+    }
12 14
     return parent::validate($value);
13 15
   }
14 16
 }
15 17
\ No newline at end of file
Please login to merge, or discard this patch.
src/Boson/DataTypes/PrimaryKey.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,9 @@
 block discarded – undo
9 9
   }
10 10
 
11 11
   public function validate($value){
12
-    if(!is_numeric($value)) return false;
12
+    if(!is_numeric($value)) {
13
+        return false;
14
+    }
13 15
     return parent::validate($value);
14 16
 }
15 17
 }
16 18
\ No newline at end of file
Please login to merge, or discard this patch.