@@ -103,7 +103,7 @@ |
||
103 | 103 | |
104 | 104 | $radio = $this->getDom()->createElement('input'); |
105 | 105 | $radio->setAttribute('type', 'checkbox'); |
106 | - $fieldName = $this->isMultiCheckbox ? $field->getName() . '[]' : $field->getName(); |
|
106 | + $fieldName = $this->isMultiCheckbox ? $field->getName().'[]' : $field->getName(); |
|
107 | 107 | $radio->setAttribute('name', $fieldName); |
108 | 108 | $radio->setAttribute('value', $value); |
109 | 109 | $text = $this->createText($labelText); |
@@ -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 |
@@ -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; |
@@ -53,7 +53,8 @@ |
||
53 | 53 | /** |
54 | 54 | * @param FieldInterface $field |
55 | 55 | * @param $value |
56 | - * @param $labelText |
|
56 | + * @param $labelText |
|
57 | + * @param boolean $inline |
|
57 | 58 | * @return DOMElement |
58 | 59 | */ |
59 | 60 | private function processOption(FieldInterface $field, $value, $labelText, $inline) |
@@ -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 |
@@ -31,12 +31,12 @@ |
||
31 | 31 | |
32 | 32 | public function render(): string |
33 | 33 | { |
34 | - return '<script src="https://www.google.com/recaptcha/api.js?render=' . $this->siteKey . '"></script> |
|
34 | + return '<script src="https://www.google.com/recaptcha/api.js?render='.$this->siteKey.'"></script> |
|
35 | 35 | <script> |
36 | 36 | $(document).ready(function(){ |
37 | 37 | $(\'#captcha\').parent().parent().parent().hide(); |
38 | 38 | grecaptcha.ready(function() { |
39 | - grecaptcha.execute(\'' . $this->siteKey . '\', {action: \'homepage\'}).then(function(token) { |
|
39 | + grecaptcha.execute(\'' . $this->siteKey.'\', {action: \'homepage\'}).then(function(token) { |
|
40 | 40 | $(\'#captcha\').val(token); |
41 | 41 | }); |
42 | 42 | }); |
@@ -73,9 +73,9 @@ |
||
73 | 73 | { |
74 | 74 | $word = ''; |
75 | 75 | |
76 | - for ($x = 0; $x < $this->length; $x ++) { |
|
77 | - $word .= chr(rand(97, 122)); |
|
78 | - } |
|
76 | + for ($x = 0; $x < $this->length; $x ++) { |
|
77 | + $word .= chr(rand(97, 122)); |
|
78 | + } |
|
79 | 79 | |
80 | 80 | return $word; |
81 | 81 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $word = $this->word; |
64 | 64 | $figlet = new Figlet(); |
65 | 65 | |
66 | - return '<div class="mono">' . ($figlet->render($word)) . '</div>'; |
|
66 | + return '<div class="mono">'.($figlet->render($word)).'</div>'; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | { |
74 | 74 | $word = ''; |
75 | 75 | |
76 | - for ($x = 0; $x < $this->length; $x ++) { |
|
76 | + for ($x = 0; $x < $this->length; $x++) { |
|
77 | 77 | $word .= chr(rand(97, 122)); |
78 | 78 | } |
79 | 79 |
@@ -37,8 +37,8 @@ |
||
37 | 37 | $validExtensions = $this->validExtensions; |
38 | 38 | $last = array_pop($validExtensions); |
39 | 39 | $extensions = implode(', ', $validExtensions); |
40 | - $extensions .= ' or ' . $last; |
|
40 | + $extensions .= ' or '.$last; |
|
41 | 41 | |
42 | - return ['The file must be either a ' . $extensions . ' file.']; |
|
42 | + return ['The file must be either a '.$extensions.' file.']; |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | \ No newline at end of file |