Code Duplication    Length = 29-30 lines in 2 locations

src/Form/Type/Base/Password.php 1 location

@@ 13-42 (lines=30) @@
10
 * @package Faulancer\Form\Type\Base
11
 * @author Florian Knapp <[email protected]>
12
 */
13
class Password extends AbstractType
14
{
15
16
    /** @var string */
17
    protected $inputType = 'input';
18
19
    /** @var string */
20
    protected $element = '';
21
22
    /**
23
     * @return self
24
     */
25
    public function create()
26
    {
27
        parent::create();
28
29
        $output = '<' . $this->inputType;
30
31
        foreach ($this->definition['attributes'] as $attr => $value) {
32
            $output .= ' ' . $attr . '="' . $value . '" ';
33
        }
34
35
        $output .= ' />';
36
37
        $this->element = $output;
38
39
        return $this;
40
    }
41
42
}

src/Form/Type/Base/Submit.php 1 location

@@ 13-41 (lines=29) @@
10
 * @package Faulancer\Form\Type\Base
11
 * @author Florian Knapp <[email protected]>
12
 */
13
class Submit extends AbstractType
14
{
15
    /** @var string */
16
    protected $inputType = 'button';
17
18
    /** @var string */
19
    protected $element = '';
20
21
    /**
22
     * @return self
23
     */
24
    public function create()
25
    {
26
        parent::create();
27
28
        $output = '<' . $this->inputType;
29
30
        foreach ($this->definition['attributes'] as $attr => $value) {
31
            $output .= ' ' . $attr . '="' . $value . '" ';
32
        }
33
34
        $output .= '>' . $this->getLabel() . '</button>';
35
36
        $this->element = $output;
37
38
        return $this;
39
    }
40
41
}