@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | { |
55 | 55 | $formGroup = new static(new Fields([$field])); |
56 | 56 | |
57 | - if($field->getLabel()) $formGroup->label($field->getLabel()); |
|
58 | - if($field->getDescription()) $formGroup->description($field->getDescription()); |
|
57 | + if ($field->getLabel()) $formGroup->label($field->getLabel()); |
|
58 | + if ($field->getDescription()) $formGroup->description($field->getDescription()); |
|
59 | 59 | $formGroup->markAsRequired($field->required()); |
60 | 60 | |
61 | 61 | return $formGroup; |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | public function fields(): Fields |
65 | 65 | { |
66 | 66 | // Manipulate each field with a custom view, unless specifically set. |
67 | - $this->fields = $this->fields->map(function(Field $field){ |
|
68 | - if(!$field->hasCustomView()){ |
|
67 | + $this->fields = $this->fields->map(function(Field $field) { |
|
68 | + if (!$field->hasCustomView()) { |
|
69 | 69 | $field->view(static::$fieldView); // Field should be immutable but it's not, ... |
70 | 70 | } |
71 | 71 | |
@@ -179,6 +179,6 @@ discard block |
||
179 | 179 | |
180 | 180 | private static function generateRandomKey(): string |
181 | 181 | { |
182 | - return md5(time() . mt_rand(1,9999)); |
|
182 | + return md5(time().mt_rand(1, 9999)); |
|
183 | 183 | } |
184 | 184 | } |
@@ -54,8 +54,12 @@ |
||
54 | 54 | { |
55 | 55 | $formGroup = new static(new Fields([$field])); |
56 | 56 | |
57 | - if($field->getLabel()) $formGroup->label($field->getLabel()); |
|
58 | - if($field->getDescription()) $formGroup->description($field->getDescription()); |
|
57 | + if($field->getLabel()) { |
|
58 | + $formGroup->label($field->getLabel()); |
|
59 | + } |
|
60 | + if($field->getDescription()) { |
|
61 | + $formGroup->description($field->getDescription()); |
|
62 | + } |
|
59 | 63 | $formGroup->markAsRequired($field->required()); |
60 | 64 | |
61 | 65 | return $formGroup; |