Code Duplication    Length = 7-9 lines in 3 locations

src/HTMLForm/FormModelCheckbox.php 1 location

@@ 68-76 (lines=9) @@
65
    public function callbackSubmit()
66
    {
67
        $elements = ["accept_mail", "accept_phone", "accept_agreement"];
68
        foreach ($elements as $name) {
69
            $this->form->addOutput(
70
                "$name is "
71
                . ($this->form->value($name)
72
                    ? ""
73
                    : "not ")
74
                . "checked</br>"
75
            );
76
        }
77
78
        // Remember values during resubmit, for sake of the example
79
        $this->form->rememberValues();

src/HTMLForm/FormModelElementsAll.php 1 location

@@ 240-246 (lines=7) @@
237
        $elements = [
238
            "selectm",
239
        ];
240
        foreach ($elements as $name) {
241
            $this->form->addOutput(
242
                "$name has value: "
243
                . implode($this->form->value($name), ", ")
244
                . "</br>"
245
            );
246
        }
247
248
        // Remember values during resubmit, useful when failing (retunr false)
249
        // and asking the user to resubmit the form.

src/HTMLForm/FormModelElementsHTML401.php 1 location

@@ 147-153 (lines=7) @@
144
        $elements = [
145
            "selectm",
146
        ];
147
        foreach ($elements as $name) {
148
            $this->form->addOutput(
149
                "$name has value: "
150
                . implode($this->form->value($name), ", ")
151
                . "</br>"
152
            );
153
        }
154
155
        // Remember values during resubmit, useful when failing (retunr false)
156
        // and asking the user to resubmit the form.