TextField::html()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Mezon\Gui\Field;
3
4
use Mezon\Gui\Control;
5
6
/**
7
 * Class TextField
8
 *
9
 * @package Field
10
 * @subpackage TextField
11
 * @author Dodonov A.A.
12
 * @version v.1.0 (2019/09/04)
13
 * @copyright Copyright (c) 2019, http://aeon.su
14
 */
15
16
/**
17
 * Text field control
18
 */
19
class TextField implements Control
20
{
21
22
    /**
23
     * Text content
24
     *
25
     * @var string
26
     */
27
    protected $text = '';
28
29
    /**
30
     * Constructor
31
     *
32
     * @param array $fieldDescription
33
     *            Field description
34
     */
35
    public function __construct(array $fieldDescription)
36
    {
37
        if (isset($fieldDescription['text'])) {
38
            $this->text = $fieldDescription['text'];
39
        }
40
    }
41
42
    /**
43
     * Generating input feld
44
     *
45
     * @return string HTML representation of the input field
46
     */
47
    public function html(): string
48
    {
49
        return $this->text;
50
    }
51
52
    /**
53
     * Does control fills all row
54
     */
55
    public function fillAllRow(): bool
56
    {
57
        return true;
58
    }
59
}
60