Textarea   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 6

1 Method

Rating   Name   Duplication   Size   Complexity  
A html() 0 12 6
1
<?php
2
namespace Mezon\Gui\Field;
3
4
use Mezon\Gui\Field;
5
6
/**
7
 * Class Textarea
8
 *
9
 * @package Field
10
 * @subpackage Textarea
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 area control
18
 */
19
class Textarea extends Field
20
{
21
22
    /**
23
     * Generating textarea field
24
     *
25
     * @return string HTML representation of the textarea field
26
     */
27
    public function html(): string
28
    {
29
        $content = '<textarea class="resizable_textarea '.$this->class.'"';
30
        $content .= $this->required ? ' required="required"' : '';
31
        $content .= ' type="text" name="' . $this->getNamePrefix() . $this->name .
32
            ($this->batch ? '[{_creation_form_items_counter}]' : '') . '"';
33
        $content .= $this->disabled ? ' disabled ' : '';
34
        $content .= $this->toggler === '' ? '' : 'toggler="' . $this->toggler . '" ';
35
        $content .= $this->toggler === '' ? '' : 'toggle-value="' . $this->toggleValue . '"';
36
        $content .= '>' . $this->value;
37
38
        return $content . '</textarea>';
39
    }
40
}
41