Completed
Push — master ( 0196bf...0df159 )
by Helmut
02:29
created
src/Fields/Text/Text.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function setValueFromModel($model)
43 43
     {
44
-        if (property_exists($model, $this->name)) $this->value = $model->{$this->name};
44
+        if (property_exists($model, $this->name)) {
45
+            $this->value = $model->{$this->name};
46
+        }
45 47
     }
46 48
 
47 49
     public function setValueFromRequest($request)
@@ -51,7 +53,9 @@  discard block
 block discarded – undo
51 53
 
52 54
     public function fillModelWithValue($model)
53 55
     {
54
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value;
56
+        if (property_exists($model, $this->name)) {
57
+            $model->{$this->name} = $this->value;
58
+        }
55 59
     }   
56 60
 
57 61
     public function validateRequired()
Please login to merge, or discard this patch.
src/Fields/Dropdown/Dropdown.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function setValueFromModel($model)
43 43
     {
44
-        if (property_exists($model, $this->name)) $this->value = $model->{$this->name};
44
+        if (property_exists($model, $this->name)) {
45
+            $this->value = $model->{$this->name};
46
+        }
45 47
     }
46 48
 
47 49
     public function setValueFromRequest($request)
@@ -51,7 +53,9 @@  discard block
 block discarded – undo
51 53
 
52 54
     public function fillModelWithValue($model)
53 55
     {
54
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value;
56
+        if (property_exists($model, $this->name)) {
57
+            $model->{$this->name} = $this->value;
58
+        }
55 59
     }   
56 60
 
57 61
     public function validateRequired()
Please login to merge, or discard this patch.
src/Fields/Email/Email.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function setValueFromModel($model)
43 43
     {
44
-        if (property_exists($model, $this->name)) $this->value = $model->{$this->name};
44
+        if (property_exists($model, $this->name)) {
45
+            $this->value = $model->{$this->name};
46
+        }
45 47
     }
46 48
 
47 49
     public function setValueFromRequest($request)
@@ -51,7 +53,9 @@  discard block
 block discarded – undo
51 53
 
52 54
     public function fillModelWithValue($model)
53 55
     {
54
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value;
56
+        if (property_exists($model, $this->name)) {
57
+            $model->{$this->name} = $this->value;
58
+        }
55 59
     }   
56 60
 
57 61
     public function validateRequired()
Please login to merge, or discard this patch.
src/Fields/Number/Number.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function setValueFromModel($model)
43 43
     {
44
-        if (property_exists($model, $this->name)) $this->value = $model->{$this->name};
44
+        if (property_exists($model, $this->name)) {
45
+            $this->value = $model->{$this->name};
46
+        }
45 47
     }
46 48
 
47 49
     public function setValueFromRequest($request)
@@ -51,7 +53,9 @@  discard block
 block discarded – undo
51 53
 
52 54
     public function fillModelWithValue($model)
53 55
     {
54
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value;
56
+        if (property_exists($model, $this->name)) {
57
+            $model->{$this->name} = $this->value;
58
+        }
55 59
     }   
56 60
 
57 61
     public function validateRequired()
Please login to merge, or discard this patch.
src/Fields/ParagraphText/ParagraphText.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function setValueFromModel($model)
43 43
     {
44
-        if (property_exists($model, $this->name)) $this->value = $model->{$this->name};
44
+        if (property_exists($model, $this->name)) {
45
+            $this->value = $model->{$this->name};
46
+        }
45 47
     }
46 48
 
47 49
     public function setValueFromRequest($request)
@@ -51,7 +53,9 @@  discard block
 block discarded – undo
51 53
 
52 54
     public function fillModelWithValue($model)
53 55
     {
54
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value;
56
+        if (property_exists($model, $this->name)) {
57
+            $model->{$this->name} = $this->value;
58
+        }
55 59
     }   
56 60
 
57 61
     public function validateRequired()
Please login to merge, or discard this patch.
src/Fields/Search/Search.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function setValueFromModel($model)
43 43
     {
44
-        if (property_exists($model, $this->name)) $this->value = $model->{$this->name};
44
+        if (property_exists($model, $this->name)) {
45
+            $this->value = $model->{$this->name};
46
+        }
45 47
     }
46 48
 
47 49
     public function setValueFromRequest($request)
@@ -51,7 +53,9 @@  discard block
 block discarded – undo
51 53
 
52 54
     public function fillModelWithValue($model)
53 55
     {
54
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value;
56
+        if (property_exists($model, $this->name)) {
57
+            $model->{$this->name} = $this->value;
58
+        }
55 59
     }   
56 60
 
57 61
     public function validateRequired()
Please login to merge, or discard this patch.
src/Field.php 1 patch
Braces   +22 added lines, -10 removed lines patch added patch discarded remove patch
@@ -179,9 +179,11 @@  discard block
 block discarded – undo
179 179
     {
180 180
         $values = $this->getValue();
181 181
 
182
-        if (is_null($values)) $values = [];
183
-
184
-        else if ( ! is_array($values)) $values = [$this->name => $values];
182
+        if (is_null($values)) {
183
+            $values = [];
184
+        } else if ( ! is_array($values)) {
185
+            $values = [$this->name => $values];
186
+        }
185 187
 
186 188
         return $values;
187 189
     }
@@ -196,7 +198,9 @@  discard block
 block discarded – undo
196 198
     {
197 199
         $properties = $this->renderWith();
198 200
 
199
-        if (is_null($properties)) $properties = [];
201
+        if (is_null($properties)) {
202
+            $properties = [];
203
+        }
200 204
 
201 205
         return $properties;
202 206
     }
@@ -210,9 +214,11 @@  discard block
 block discarded – undo
210 214
     {
211 215
         $buttons = $this->getButtonName();
212 216
 
213
-        if (is_null($buttons)) $buttons = [];
214
-
215
-        else if ( ! is_array($buttons)) $buttons = [$buttons];
217
+        if (is_null($buttons)) {
218
+            $buttons = [];
219
+        } else if ( ! is_array($buttons)) {
220
+            $buttons = [$buttons];
221
+        }
216 222
 
217 223
         return $buttons;
218 224
     }
@@ -224,7 +230,9 @@  discard block
 block discarded – undo
224 230
      */ 
225 231
     public function setFromDefault()
226 232
     {
227
-        if ( ! is_null($this->default)) $this->setValueFromDefault();
233
+        if ( ! is_null($this->default)) {
234
+            $this->setValueFromDefault();
235
+        }
228 236
     }
229 237
 
230 238
     /**
@@ -412,7 +420,9 @@  discard block
 block discarded – undo
412 420
      */
413 421
     public function error($message)
414 422
     {
415
-        if ( ! isset($this->errors['userDefined'])) $this->errors['userDefined'] = [];
423
+        if ( ! isset($this->errors['userDefined'])) {
424
+            $this->errors['userDefined'] = [];
425
+        }
416 426
 
417 427
         $this->errors['userDefined'][] = $message;
418 428
     }
@@ -437,7 +447,9 @@  discard block
 block discarded – undo
437 447
      */
438 448
     protected function clearValidationError($method) 
439 449
     {
440
-        if (isset($this->errors[$method])) unset($this->errors[$method]);
450
+        if (isset($this->errors[$method])) {
451
+            unset($this->errors[$method]);
452
+        }
441 453
     }    
442 454
 
443 455
     /**
Please login to merge, or discard this patch.