Completed
Branch master (37b207)
by Helmut
10:03 queued 16s
created
src/Field.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -347,7 +347,9 @@  discard block
 block discarded – undo
347 347
             return false;
348 348
         }
349 349
 
350
-        if (isset($this->errors[$method])) unset($this->errors[$method]);
350
+        if (isset($this->errors[$method])) {
351
+            unset($this->errors[$method]);
352
+        }
351 353
 
352 354
         return true;
353 355
     }
@@ -389,7 +391,9 @@  discard block
 block discarded – undo
389 391
      */
390 392
     public function error($message)
391 393
     {
392
-        if ( ! isset($this->errors['userDefined'])) $this->errors['userDefined'] = [];
394
+        if ( ! isset($this->errors['userDefined'])) {
395
+            $this->errors['userDefined'] = [];
396
+        }
393 397
 
394 398
         $this->errors['userDefined'][] = $message;
395 399
     }
Please login to merge, or discard this patch.
src/Fields/Dropdown/Dropdown.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,12 +37,16 @@  discard block
 block discarded – undo
37 37
 
38 38
     public function setValuesFromDefaults($defaults)
39 39
     {
40
-        if (count($defaults)) $this->value = array_shift($defaults);
40
+        if (count($defaults)) {
41
+            $this->value = array_shift($defaults);
42
+        }
41 43
     }
42 44
 
43 45
     public function setValuesFromModel($model)
44 46
     {
45
-        if (property_exists($model, $this->name)) $this->value = $model->{$this->name};
47
+        if (property_exists($model, $this->name)) {
48
+            $this->value = $model->{$this->name};
49
+        }
46 50
     }   
47 51
 
48 52
     public function setValuesFromRequest($request)
@@ -52,7 +56,9 @@  discard block
 block discarded – undo
52 56
 
53 57
     public function fillModelWithValues($model)
54 58
     {
55
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value;
59
+        if (property_exists($model, $this->name)) {
60
+            $model->{$this->name} = $this->value;
61
+        }
56 62
     }   
57 63
 
58 64
     public function validateRequired()
Please login to merge, or discard this patch.
src/Fields/Text/Text.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,12 +32,16 @@  discard block
 block discarded – undo
32 32
 
33 33
     public function setValuesFromDefaults($defaults)
34 34
     {
35
-        if (count($defaults)) $this->value = array_shift($defaults);
35
+        if (count($defaults)) {
36
+            $this->value = array_shift($defaults);
37
+        }
36 38
     }
37 39
 
38 40
     public function setValuesFromModel($model)
39 41
     {
40
-        if (property_exists($model, $this->name)) $this->value = $model->{$this->name};
42
+        if (property_exists($model, $this->name)) {
43
+            $this->value = $model->{$this->name};
44
+        }
41 45
     }
42 46
 
43 47
     public function setValuesFromRequest($request)
@@ -47,7 +51,9 @@  discard block
 block discarded – undo
47 51
 
48 52
     public function fillModelWithValues($model)
49 53
     {
50
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value;
54
+        if (property_exists($model, $this->name)) {
55
+            $model->{$this->name} = $this->value;
56
+        }
51 57
     }   
52 58
 
53 59
     public function validateRequired()
Please login to merge, or discard this patch.
src/Fields/Number/Number.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,12 +32,16 @@  discard block
 block discarded – undo
32 32
 
33 33
     public function setValuesFromDefaults($defaults)
34 34
     {
35
-        if (count($this->defaults)) $this->value = array_shift($this->defaults);
35
+        if (count($this->defaults)) {
36
+            $this->value = array_shift($this->defaults);
37
+        }
36 38
     }
37 39
 
38 40
     public function setValuesFromModel($model)
39 41
     {
40
-        if (property_exists($model, $this->name)) $this->value = $model->{$this->name};
42
+        if (property_exists($model, $this->name)) {
43
+            $this->value = $model->{$this->name};
44
+        }
41 45
     }
42 46
 
43 47
     public function setValuesFromRequest($request)
@@ -47,7 +51,9 @@  discard block
 block discarded – undo
47 51
 
48 52
     public function fillModelWithValues($model)
49 53
     {
50
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value;
54
+        if (property_exists($model, $this->name)) {
55
+            $model->{$this->name} = $this->value;
56
+        }
51 57
     }   
52 58
 
53 59
     public function validate()
Please login to merge, or discard this patch.
src/Fields/ParagraphText/ParagraphText.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,12 +25,16 @@  discard block
 block discarded – undo
25 25
 
26 26
     public function setValuesFromDefaults($defaults)
27 27
     {
28
-        if (count($defaults)) $this->value = array_shift($defaults);
28
+        if (count($defaults)) {
29
+            $this->value = array_shift($defaults);
30
+        }
29 31
     }
30 32
 
31 33
     public function setValuesFromModel($model)
32 34
     {
33
-        if (property_exists($model, $this->name)) $this->value = $model->{$this->name};
35
+        if (property_exists($model, $this->name)) {
36
+            $this->value = $model->{$this->name};
37
+        }
34 38
     }
35 39
 
36 40
     public function setValuesFromRequest($request)
@@ -40,7 +44,9 @@  discard block
 block discarded – undo
40 44
 
41 45
     public function fillModelWithValues($model)
42 46
     {
43
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value;
47
+        if (property_exists($model, $this->name)) {
48
+            $model->{$this->name} = $this->value;
49
+        }
44 50
     }   
45 51
 
46 52
     public function validateRequired()
Please login to merge, or discard this patch.
src/Fields/Name/Name.php 1 patch
Braces   +21 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,15 +35,23 @@  discard block
 block discarded – undo
35 35
 
36 36
     public function setValuesFromDefaults($defaults)
37 37
     {
38
-        if (isset($defaults['first'])) $this->value_first = $defaults['first'];
39
-        if (isset($defaults['surname'])) $this->value_surname = $defaults['surname'];
38
+        if (isset($defaults['first'])) {
39
+            $this->value_first = $defaults['first'];
40
+        }
41
+        if (isset($defaults['surname'])) {
42
+            $this->value_surname = $defaults['surname'];
43
+        }
40 44
         $this->value = trim($this->value_first.' '.$this->value_surname);
41 45
     }
42 46
 
43 47
     public function setValuesFromModel($model)
44 48
     {
45
-        if (property_exists($model, $this->name.'_first')) $this->value_first = $model->{$this->name.'_first'};
46
-        if (property_exists($model, $this->name.'_surname')) $this->value_surname = $model->{$this->name.'_surname'};
49
+        if (property_exists($model, $this->name.'_first')) {
50
+            $this->value_first = $model->{$this->name.'_first'};
51
+        }
52
+        if (property_exists($model, $this->name.'_surname')) {
53
+            $this->value_surname = $model->{$this->name.'_surname'};
54
+        }
47 55
         $this->value = trim($this->value_first.' '.$this->value_surname);
48 56
     }
49 57
 
@@ -56,9 +64,15 @@  discard block
 block discarded – undo
56 64
 
57 65
     public function fillModelWithValues($model)
58 66
     {
59
-        if (property_exists($model, $this->name.'_first')) $model->{$this->name.'_first'} = $this->value_first;
60
-        if (property_exists($model, $this->name.'_surname')) $model->{$this->name.'_surname'} = $this->value_surname;
61
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value;
67
+        if (property_exists($model, $this->name.'_first')) {
68
+            $model->{$this->name.'_first'} = $this->value_first;
69
+        }
70
+        if (property_exists($model, $this->name.'_surname')) {
71
+            $model->{$this->name.'_surname'} = $this->value_surname;
72
+        }
73
+        if (property_exists($model, $this->name)) {
74
+            $model->{$this->name} = $this->value;
75
+        }
62 76
     }
63 77
 
64 78
     public function validateRequired()
Please login to merge, or discard this patch.
src/Fields/Checkboxes/Checkboxes.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -82,14 +82,18 @@  discard block
 block discarded – undo
82 82
     public function setValuesFromDefaults($defaults)
83 83
     {
84 84
         foreach (array_keys($this->options) as $key) {
85
-            if (isset($defaults[$key])) $this->values[$key] = $defaults[$key] ? true : false;
85
+            if (isset($defaults[$key])) {
86
+                $this->values[$key] = $defaults[$key] ? true : false;
87
+            }
86 88
         }
87 89
     }
88 90
 
89 91
     public function setValuesFromModel($model)
90 92
     {
91 93
         foreach (array_keys($this->options) as $key) {
92
-            if (property_exists($model, $this->name.'_'.$key)) $this->values[$key] = $model->{$this->name.'_'.$key} ? true : false;
94
+            if (property_exists($model, $this->name.'_'.$key)) {
95
+                $this->values[$key] = $model->{$this->name.'_'.$key} ? true : false;
96
+            }
93 97
         }
94 98
 
95 99
     }   
@@ -104,7 +108,9 @@  discard block
 block discarded – undo
104 108
     public function fillModelWithValues($model)
105 109
     {
106 110
         foreach (array_keys($this->options) as $key) {
107
-            if (property_exists($model, $this->name.'_'.$key)) $model->{$this->name.'_'.$key} = $this->values[$key] ? 1 : 0;
111
+            if (property_exists($model, $this->name.'_'.$key)) {
112
+                $model->{$this->name.'_'.$key} = $this->values[$key] ? 1 : 0;
113
+            }
108 114
         }
109 115
     }   
110 116
 
@@ -113,7 +119,9 @@  discard block
 block discarded – undo
113 119
         $checked = false;
114 120
 
115 121
         foreach (array_keys($this->options) as $key) {
116
-            if ($this->values[$key]) $checked = true;
122
+            if ($this->values[$key]) {
123
+                $checked = true;
124
+            }
117 125
         }
118 126
 
119 127
         return $checked;
Please login to merge, or discard this patch.
src/Fields/Checkbox/Checkbox.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,9 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function setValuesFromModel($model)
44 44
     {
45
-        if (property_exists($model, $this->name)) $this->value = $model->{$this->name} ? true : false;
45
+        if (property_exists($model, $this->name)) {
46
+            $this->value = $model->{$this->name} ? true : false;
47
+        }
46 48
     }   
47 49
 
48 50
     public function setValuesFromRequest($request)
@@ -52,7 +54,9 @@  discard block
 block discarded – undo
52 54
 
53 55
     public function fillModelWithValues($model)
54 56
     {
55
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value ? 1 : 0;
57
+        if (property_exists($model, $this->name)) {
58
+            $model->{$this->name} = $this->value ? 1 : 0;
59
+        }
56 60
     }
57 61
 
58 62
     public function validateRequired()
Please login to merge, or discard this patch.
src/Fields/Email/Email.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,12 +25,16 @@  discard block
 block discarded – undo
25 25
 
26 26
     public function setValuesFromDefaults($defaults)
27 27
     {
28
-        if (count($defaults)) $this->value = array_shift($defaults);
28
+        if (count($defaults)) {
29
+            $this->value = array_shift($defaults);
30
+        }
29 31
     }
30 32
 
31 33
     public function setValuesFromModel($model)
32 34
     {
33
-        if (property_exists($model, $this->name)) $this->value = $model->{$this->name};
35
+        if (property_exists($model, $this->name)) {
36
+            $this->value = $model->{$this->name};
37
+        }
34 38
     }   
35 39
 
36 40
     public function setValuesFromRequest($request)
@@ -40,7 +44,9 @@  discard block
 block discarded – undo
40 44
 
41 45
     public function fillModelWithValues($model)
42 46
     {
43
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value;
47
+        if (property_exists($model, $this->name)) {
48
+            $model->{$this->name} = $this->value;
49
+        }
44 50
     }   
45 51
 
46 52
     public function validate()
Please login to merge, or discard this patch.