Completed
Push — master ( 9bb1a7...9f8480 )
by Helmut
06:35
created
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/Name/lang/es.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php 
2 2
 
3 3
 return [
4
-	'placeholder_first' => 'Nombre',
5
-	'placeholder_surname' => 'Apellido',
4
+    'placeholder_first' => 'Nombre',
5
+    'placeholder_surname' => 'Apellido',
6 6
 ];
7 7
\ No newline at end of file
Please login to merge, or discard this patch.
src/Fields/Name/lang/en.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php 
2 2
 
3 3
 return [
4
-	'placeholder_first' => 'First',
5
-	'placeholder_surname' => 'Surname',
4
+    'placeholder_first' => 'First',
5
+    'placeholder_surname' => 'Surname',
6 6
 ];
7 7
\ No newline at end of file
Please login to merge, or discard this patch.
src/Fields/Name/Name.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 
27 27
     public function getProperties() 
28 28
     {
29
-        return [    'name_first' => $this->name.'_first', 
29
+        return ['name_first' => $this->name.'_first', 
30 30
                     'name_surname' => $this->name.'_surname', 
31 31
                     'value_first' => $this->value_first, 
32 32
                     'value_surname' => $this->value_surname,
Please login to merge, or discard this 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 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@
 block discarded – undo
25 25
 
26 26
     public function setChecked()
27 27
     {
28
-         $this->defaults = [true];
29
-         return $this;
28
+            $this->defaults = [true];
29
+            return $this;
30 30
     }
31 31
 
32 32
     public function setUnchecked()
33 33
     {
34
-         $this->defaults = [false];
35
-         return $this;
34
+            $this->defaults = [false];
35
+            return $this;
36 36
     }   
37 37
 
38 38
     public function setValuesFromDefaults($defaults)
Please login to merge, or discard this 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/lang/es.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php 
2 2
 
3 3
 return [
4
-	'placeholder' => '[email protected]',
4
+    'placeholder' => '[email protected]',
5 5
 ];
6 6
\ No newline at end of file
Please login to merge, or discard this patch.
src/Fields/Email/lang/en.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php 
2 2
 
3 3
 return [
4
-	'placeholder' => '[email protected]',
4
+    'placeholder' => '[email protected]',
5 5
 ];
6 6
\ No newline at end of file
Please login to merge, or discard this patch.
src/Fields/Password/Password.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
     public function needsRehash($hash = null)
21 21
     {
22
-        if (is_null($hash)) $hash = $this->value;
22
+        if (is_null($hash)) {
23
+            $hash = $this->value;
24
+        }
23 25
 
24 26
         return password_needs_rehash($hash, PASSWORD_BCRYPT, ['cost' => 10]);
25 27
     }   
@@ -57,7 +59,9 @@  discard block
 block discarded – undo
57 59
 
58 60
     public function setValuesFromModel($model)
59 61
     {
60
-        if (property_exists($model, $this->name)) $this->value = $model->{$this->name};
62
+        if (property_exists($model, $this->name)) {
63
+            $this->value = $model->{$this->name};
64
+        }
61 65
     }
62 66
 
63 67
     public function setValuesFromRequest($request)
@@ -67,7 +71,9 @@  discard block
 block discarded – undo
67 71
 
68 72
     public function fillModelWithValues($model)
69 73
     {
70
-        if (property_exists($model, $this->name)) $model->{$this->name} = $this->value;
74
+        if (property_exists($model, $this->name)) {
75
+            $model->{$this->name} = $this->value;
76
+        }
71 77
     }   
72 78
 
73 79
     public function validateRequired()
Please login to merge, or discard this patch.