Passed
Branch main (12de61)
by Sammy
24:16 queued 16:01
created
src/Model.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,8 @@
 block discarded – undo
35 35
         if (property_exists($this, $prop_name) === true) {
36 36
         {
37 37
             $this->$prop_name = $value;
38
+        } else {
39
+          parent::set($prop_name, $value);
38 40
         }
39
-        else parent::set($prop_name, $value);
40 41
     }
41 42
 }
Please login to merge, or discard this patch.
src/TableModel.php 1 patch
Braces   +5 added lines, -7 removed lines patch added patch discarded remove patch
@@ -146,15 +146,13 @@
 block discarded – undo
146 146
     {
147 147
         $datass = [];
148 148
 
149
-        if(!is_null($arg2))
150
-            $datass = [$arg1 => $arg2];
151
-        elseif(!is_array($arg1) && count(get_called_class()::table()->primaryKeys()) === 1){
149
+        if(!is_null($arg2)) {
150
+                    $datass = [$arg1 => $arg2];
151
+        } elseif(!is_array($arg1) && count(get_called_class()::table()->primaryKeys()) === 1){
152 152
             $datass = [current(get_called_class()::table()->primaryKeys())->name() => $arg1];
153
-        }
154
-        elseif(is_array($arg1)){
153
+        } elseif(is_array($arg1)){
155 154
           $datass = $arg1;
156
-        }
157
-        else{
155
+        } else{
158 156
             throw new CruditesException('ARGUMENTS_ARE_NOT_ACTIONNABLE');
159 157
         }
160 158
 
Please login to merge, or discard this patch.
src/TightModel.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,8 +73,9 @@
 block discarded – undo
73 73
                 $errors = $this->validate();
74 74
               }
75 75
             }
76
-            if (!empty($errors))
77
-              return $errors;
76
+            if (!empty($errors)) {
77
+                          return $errors;
78
+            }
78 79
 
79 80
 
80 81
             // a tight model *always* match a single table row
Please login to merge, or discard this patch.