@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
178 | - * @param array $dynamicForms |
|
178 | + * @param FormInterface[] $dynamicForms |
|
179 | 179 | * @param array $data |
180 | 180 | */ |
181 | 181 | private function populateDynamicForms(array $dynamicForms, array $data): void |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | } |
349 | 349 | |
350 | 350 | /** |
351 | - * @param boolean $displayError |
|
351 | + * @param boolean $displayErrors |
|
352 | 352 | */ |
353 | 353 | public function setDisplayErrors(bool $displayErrors): void |
354 | 354 | { |
@@ -2,12 +2,12 @@ |
||
2 | 2 | |
3 | 3 | namespace Del\Form; |
4 | 4 | |
5 | -use Del\Form\Collection\FieldCollection; |
|
6 | -use Del\Form\Field\CheckBox; |
|
7 | -use Del\Form\Field\FieldInterface; |
|
8 | -use Del\Form\Field\FileUpload; |
|
9 | -use Del\Form\Renderer\FormRenderer; |
|
10 | -use Del\Form\Renderer\FormRendererInterface; |
|
5 | +use Del\Form\Collection\FieldCollection; |
|
6 | +use Del\Form\Field\CheckBox; |
|
7 | +use Del\Form\Field\FieldInterface; |
|
8 | +use Del\Form\Field\FileUpload; |
|
9 | +use Del\Form\Renderer\FormRenderer; |
|
10 | +use Del\Form\Renderer\FormRendererInterface; |
|
11 | 11 | use Del\Form\Traits\HasAttributesTrait; |
12 | 12 | |
13 | 13 | abstract class AbstractForm implements FormInterface |
@@ -54,6 +54,10 @@ discard block |
||
54 | 54 | |
55 | 55 | abstract public function init(); |
56 | 56 | |
57 | + /** |
|
58 | + * @param string $name |
|
59 | + * @param string $value |
|
60 | + */ |
|
57 | 61 | public function __construct($name, $value = null) |
58 | 62 | { |
59 | 63 | $this->required = false; |
@@ -158,7 +162,7 @@ discard block |
||
158 | 162 | } |
159 | 163 | |
160 | 164 | /** |
161 | - * @param FilterInterface $transformer |
|
165 | + * @param TransformerInterface $transformer |
|
162 | 166 | */ |
163 | 167 | public function setTransformer(TransformerInterface $transformer): void |
164 | 168 | { |
@@ -2,18 +2,16 @@ |
||
2 | 2 | |
3 | 3 | namespace Del\Form\Field; |
4 | 4 | |
5 | -use Del\Form\Collection\FilterCollection; |
|
6 | -use Del\Form\Collection\ValidatorCollection; |
|
7 | -use Del\Form\Filter\Adapter\FilterAdapterZf; |
|
8 | -use Del\Form\Filter\FilterInterface; |
|
9 | -use Del\Form\FormInterface; |
|
10 | -use Del\Form\Renderer\Field\FieldRendererInterface; |
|
11 | -use Del\Form\Renderer\Field\TextRender; |
|
12 | -use Del\Form\Traits\HasAttributesTrait; |
|
13 | -use Del\Form\Validator\NotEmpty; |
|
14 | -use Del\Form\Validator\ValidatorInterface; |
|
5 | +use Del\Form\Collection\FilterCollection; |
|
6 | +use Del\Form\Collection\ValidatorCollection; |
|
7 | +use Del\Form\Filter\FilterInterface; |
|
8 | +use Del\Form\FormInterface; |
|
9 | +use Del\Form\Renderer\Field\FieldRendererInterface; |
|
10 | +use Del\Form\Renderer\Field\TextRender; |
|
11 | +use Del\Form\Traits\HasAttributesTrait; |
|
12 | +use Del\Form\Validator\NotEmpty; |
|
13 | +use Del\Form\Validator\ValidatorInterface; |
|
15 | 14 | use Exception; |
16 | -use Laminas\Filter\ToNull; |
|
17 | 15 | |
18 | 16 | abstract class FieldAbstract implements FieldInterface |
19 | 17 | { |
@@ -15,6 +15,7 @@ discard block |
||
15 | 15 | { |
16 | 16 | /** |
17 | 17 | * @param mixed $value |
18 | + * @return void |
|
18 | 19 | */ |
19 | 20 | public function setValue($value): void; |
20 | 21 | |
@@ -25,6 +26,7 @@ discard block |
||
25 | 26 | |
26 | 27 | /** |
27 | 28 | * @param string $label |
29 | + * @return void |
|
28 | 30 | */ |
29 | 31 | public function setLabel(string $label): void; |
30 | 32 | |
@@ -55,6 +57,7 @@ discard block |
||
55 | 57 | |
56 | 58 | /** |
57 | 59 | * @param ValidatorInterface $validator |
60 | + * @return void |
|
58 | 61 | */ |
59 | 62 | public function addValidator(ValidatorInterface $validator): void; |
60 | 63 | |
@@ -65,6 +68,7 @@ discard block |
||
65 | 68 | |
66 | 69 | /** |
67 | 70 | * @param FilterInterface $filter |
71 | + * @return void |
|
68 | 72 | */ |
69 | 73 | public function addFilter(FilterInterface $filter): void; |
70 | 74 | |
@@ -74,7 +78,7 @@ discard block |
||
74 | 78 | public function getFilters(): FilterCollection; |
75 | 79 | |
76 | 80 | /** |
77 | - * @param FilterInterface $filter |
|
81 | + * @return void |
|
78 | 82 | */ |
79 | 83 | public function setTransformer(TransformerInterface $transformer): void; |
80 | 84 | |
@@ -101,6 +105,7 @@ discard block |
||
101 | 105 | |
102 | 106 | /** |
103 | 107 | * @param string $message |
108 | + * @return void |
|
104 | 109 | */ |
105 | 110 | public function setCustomErrorMessage(string $message): void; |
106 | 111 | |
@@ -122,11 +127,13 @@ discard block |
||
122 | 127 | /** |
123 | 128 | * @param $key |
124 | 129 | * @param $value |
130 | + * @return void |
|
125 | 131 | */ |
126 | 132 | public function setAttribute(string $key, $value): void; |
127 | 133 | |
128 | 134 | /** |
129 | 135 | * @param array $attributes |
136 | + * @return void |
|
130 | 137 | */ |
131 | 138 | public function setAttributes(array $attributes): void; |
132 | 139 | |
@@ -142,6 +149,7 @@ discard block |
||
142 | 149 | |
143 | 150 | /** |
144 | 151 | * @param FieldRendererInterface $renderer |
152 | + * @return void |
|
145 | 153 | */ |
146 | 154 | public function setRenderer(FieldRendererInterface $renderer): void; |
147 | 155 | |
@@ -149,12 +157,14 @@ discard block |
||
149 | 157 | |
150 | 158 | /** |
151 | 159 | * @param bool $required |
160 | + * @return void |
|
152 | 161 | */ |
153 | 162 | public function setRequired(bool $required): void; |
154 | 163 | |
155 | 164 | /** |
156 | 165 | * @param FormInterface $field |
157 | 166 | * @param $triggerValue |
167 | + * @return void |
|
158 | 168 | */ |
159 | 169 | public function addDynamicForm(FormInterface $field, string $triggerValue): void; |
160 | 170 |
@@ -6,7 +6,6 @@ |
||
6 | 6 | use Del\Form\Collection\ValidatorCollection; |
7 | 7 | use Del\Form\Filter\FilterInterface; |
8 | 8 | use Del\Form\FormInterface; |
9 | -use Del\Form\Renderer\Field\SelectRender; |
|
10 | 9 | use Del\Form\Validator\ValidatorInterface; |
11 | 10 | use Del\Form\Renderer\Field\FieldRendererInterface; |
12 | 11 | use Exception; |
@@ -63,6 +63,7 @@ |
||
63 | 63 | * @param FieldInterface $field |
64 | 64 | * @param $value |
65 | 65 | * @param $labelText |
66 | + * @param boolean $inline |
|
66 | 67 | * @return DOMElement |
67 | 68 | */ |
68 | 69 | private function processOption(FieldInterface $field, $value, $labelText, $inline) |
@@ -12,7 +12,6 @@ |
||
12 | 12 | use DOMDocumentFragment; |
13 | 13 | use DOMElement; |
14 | 14 | use DOMNode; |
15 | -use DOMText; |
|
16 | 15 | use InvalidArgumentException; |
17 | 16 | use LogicException; |
18 | 17 |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | */ |
98 | 98 | private function getLabel(FieldInterface $field, string $labelText): DOMElement |
99 | 99 | { |
100 | - $this->counter ++; |
|
100 | + $this->counter++; |
|
101 | 101 | $label = $this->getDom()->createElement('label'); |
102 | - $label->setAttribute('for', $field->getId() . $this->counter); |
|
102 | + $label->setAttribute('for', $field->getId().$this->counter); |
|
103 | 103 | $label->setAttribute('class', 'form-check-label'); |
104 | 104 | $text = $this->createText($labelText); |
105 | 105 | $label->appendChild($text); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $checkbox = $this->getDom()->createElement('input'); |
119 | 119 | $checkbox->setAttribute('class', 'form-check-input'); |
120 | 120 | $checkbox->setAttribute('type', 'checkbox'); |
121 | - $fieldName = $this->isMultiCheckbox ? $field->getName() . '[]' : $field->getName(); |
|
121 | + $fieldName = $this->isMultiCheckbox ? $field->getName().'[]' : $field->getName(); |
|
122 | 122 | $checkbox->setAttribute('name', $fieldName); |
123 | 123 | $checkbox->setAttribute('value', $value); |
124 | 124 | $fieldValue = $field->getValue(); |
@@ -2,13 +2,12 @@ |
||
2 | 2 | |
3 | 3 | namespace Del\Form\Renderer\Field; |
4 | 4 | |
5 | -use Del\Form\Field\FieldInterface; |
|
6 | -use Del\Form\Field\Radio; |
|
7 | -use DOMDocumentFragment; |
|
8 | -use DOMElement; |
|
9 | -use DOMNode; |
|
10 | -use DOMText; |
|
11 | -use InvalidArgumentException; |
|
5 | +use Del\Form\Field\FieldInterface; |
|
6 | +use Del\Form\Field\Radio; |
|
7 | +use DOMDocumentFragment; |
|
8 | +use DOMElement; |
|
9 | +use DOMNode; |
|
10 | +use InvalidArgumentException; |
|
12 | 11 | use LogicException; |
13 | 12 | |
14 | 13 | class RadioRender extends AbstractFieldRender implements FieldRendererInterface |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * @param FieldInterface $field |
56 | 56 | * @param $value |
57 | 57 | * @param $labelText |
58 | - * @param $inline |
|
58 | + * @param boolean $inline |
|
59 | 59 | * @return DOMElement |
60 | 60 | */ |
61 | 61 | private function renderRadio(FieldInterface $field, $value, $labelText, $inline) |
@@ -78,9 +78,9 @@ |
||
78 | 78 | */ |
79 | 79 | private function getLabel(FieldInterface $field, string $labelText): DOMElement |
80 | 80 | { |
81 | - $this->counter ++; |
|
81 | + $this->counter++; |
|
82 | 82 | $label = $this->getDom()->createElement('label'); |
83 | - $label->setAttribute('for', $field->getId() . $this->counter); |
|
83 | + $label->setAttribute('for', $field->getId().$this->counter); |
|
84 | 84 | $label->setAttribute('class', 'form-check-label'); |
85 | 85 | $text = $this->createText($labelText); |
86 | 86 | $label->appendChild($text); |
@@ -36,12 +36,12 @@ |
||
36 | 36 | { |
37 | 37 | $validExtensions = $this->validExtensions; |
38 | 38 | $last = array_pop($validExtensions); |
39 | - $extensions = 'The file must be a ' . $last . ' file.'; |
|
39 | + $extensions = 'The file must be a '.$last.' file.'; |
|
40 | 40 | |
41 | 41 | if (count($validExtensions) > 0) { |
42 | 42 | $extensions = implode(', ', $validExtensions); |
43 | - $extensions .= ' or ' . $last; |
|
44 | - $extensions = 'The file must be either a ' . $extensions . ' file.'; |
|
43 | + $extensions .= ' or '.$last; |
|
44 | + $extensions = 'The file must be either a '.$extensions.' file.'; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | return [$extensions]; |