InputFile   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A html() 0 11 6
1
<?php
2
namespace Mezon\Gui\Field;
3
4
use Mezon\Gui\Field;
5
6
/**
7
 * Class InputFile
8
 *
9
 * @package Field
10
 * @subpackage InputFile
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
 * Input field control
18
 */
19
class InputFile extends Field
20
{
21
22
    /**
23
     * Generating input feld
24
     *
25
     * @return string HTML representation of the input field
26
     */
27
    public function html(): string
28
    {
29
        $content = '<input class="' . $this->class . '"';
30
        $content .= $this->required ? ' required="required"' : '';
31
        $content .= ' type="file" 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
37
        return $content . '>';
38
    }
39
}
40