Code Duplication    Length = 30-31 lines in 2 locations

src/Ffcms/Core/Helper/HTML/Form/HiddenField.php 1 location

@@ 6-35 (lines=30) @@
3
4
use Ffcms\Core\Helper\HTML\System\NativeGenerator;
5
6
class HiddenField extends NativeGenerator implements iField
7
{
8
    private $properties;
9
    private $name;
10
    private $value;
11
    
12
    /**
13
     * HiddenField constructor. Pass attributes inside model.
14
     * @param array $properties
15
     * @param string $name
16
     * @param string|null $value
17
     */
18
    public function __construct($properties, $name, $value = null)
19
    {
20
        $this->properties = $properties;
21
        $this->name = $name;
22
        $this->value = $value;
23
    }
24
    
25
    /**
26
     * Build <input type="hidden" value="$value" {$properties} /> response
27
     * {@inheritDoc}
28
     * @see \Ffcms\Core\Helper\HTML\Form\iField::make()
29
     */
30
    public function make()
31
    {
32
        $this->properties['type'] = 'hidden';
33
        return self::buildSingleTag('input', $this->properties);
34
    }
35
}

src/Ffcms/Core/Helper/HTML/Form/TextField.php 1 location

@@ 6-36 (lines=31) @@
3
4
use Ffcms\Core\Helper\HTML\System\NativeGenerator;
5
6
class TextField extends NativeGenerator implements iField
7
{
8
    private $properties;
9
    private $name;
10
    private $value;
11
    
12
    /**
13
     * TextField constructor. Pass attributes inside model.
14
     * @param array $properties
15
     * @param string $name
16
     * @param string|null $value
17
     */
18
    public function __construct($properties, $name, $value = null)
19
    {
20
        $this->properties = $properties;
21
        $this->name = $name;
22
        $this->value = $value;
23
    }
24
    
25
26
    /**
27
     * Build <input type="text" value="$value" {$properties} /> response
28
     * {@inheritDoc}
29
     * @see \Ffcms\Core\Helper\HTML\Form\iField::make()
30
     */
31
    public function make()
32
    {
33
        $this->properties['type'] = 'text';
34
        return self::buildSingleTag('input', $this->properties);
35
    }
36
}