@@ -1,6 +1,6 @@ |
||
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 |
@@ -1,6 +1,6 @@ |
||
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 |
@@ -26,7 +26,7 @@ |
||
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, |
@@ -35,15 +35,23 @@ discard block |
||
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 |
||
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() |
@@ -82,14 +82,18 @@ discard block |
||
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 |
||
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 |
||
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; |
@@ -25,14 +25,14 @@ |
||
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) |
@@ -42,7 +42,9 @@ discard block |
||
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 |
||
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() |
@@ -1,5 +1,5 @@ |
||
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 |
@@ -1,5 +1,5 @@ |
||
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 |
@@ -19,7 +19,9 @@ discard block |
||
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 |
||
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 |
||
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() |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'placeholder' => 'Buscar…', |
|
5 | - 'button' => 'Ir', |
|
4 | + 'placeholder' => 'Buscar…', |
|
5 | + 'button' => 'Ir', |
|
6 | 6 | ]; |
7 | 7 | \ No newline at end of file |