Passed
Push — master ( 2afdeb...b846a2 )
by Nikolaos
06:23 queued 03:51
created

Textarea   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 26
ccs 8
cts 8
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 13 1
1
<?php
2
3
/**
4
 * This file is part of the Phalcon Framework.
5
 *
6
 * For the full copyright and license information, please view the LICENSE.md
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Phalcon\Html\Helper\Input;
13
14
use Phalcon\Html\Exception;
15
16
/**
17
 * Class Textarea
18
 */
19
class Textarea extends AbstractInput
20
{
21
    /**
22
     * @var string
23
     */
24
    protected $type = 'textarea';
25
26
    /**
27
     * Returns the HTML for the input.
28
     *
29
     * @return string
30
     * @throws Exception
31
     */
32 1
    public function __toString()
33
    {
34 1
        $attributes       = $this->attributes;
35 1
        $this->attributes = [];
36 1
        $value            = $attributes['value'] ?? '';
37
38 1
        unset($attributes['type']);
39 1
        unset($attributes['value']);
40
41 1
        return $this->renderFullElement(
42 1
            $this->type,
43
            $value,
44
            $attributes
45
        );
46
    }
47
}
48