@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | - 'validate_min' => 'The [field] field must be a minimum of [min].', |
|
| 5 | - 'validate_max' => 'The [field] field must be a maximum of [min].', |
|
| 6 | - 'validate_between' => 'The [field] field must be between [min] and [max].', |
|
| 4 | + 'validate_min' => 'The [field] field must be a minimum of [min].', |
|
| 5 | + 'validate_max' => 'The [field] field must be a maximum of [min].', |
|
| 6 | + 'validate_between' => 'The [field] field must be between [min] and [max].', |
|
| 7 | 7 | ]; |
| 8 | 8 | \ No newline at end of file |
@@ -32,12 +32,16 @@ discard block |
||
| 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 |
||
| 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() |
@@ -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 |