Textarea::rows()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Spatie\Html\Elements;
4
5
use Spatie\Html\BaseElement;
6
use Spatie\Html\Elements\Attributes\Autofocus;
7
use Spatie\Html\Elements\Attributes\Disabled;
8
use Spatie\Html\Elements\Attributes\MinMaxLength;
9
use Spatie\Html\Elements\Attributes\Name;
10
use Spatie\Html\Elements\Attributes\Placeholder;
11
use Spatie\Html\Elements\Attributes\Readonly;
12
use Spatie\Html\Elements\Attributes\Required;
13
14
class Textarea extends BaseElement
15
{
16
    use Autofocus;
17
    use Placeholder;
18
    use Name;
19
    use Required;
20
    use Disabled;
21
    use Readonly;
22
    use MinMaxLength;
23
24
    protected $tag = 'textarea';
25
26
    /**
27
     * @param string|null $value
28
     *
29
     * @return static
30
     * @throws \Spatie\Html\Exceptions\InvalidHtml
31
     */
32
    public function value($value)
33
    {
34
        return $this->html($value);
35
    }
36
37
    /**
38
     * @param int $rows
39
     *
40
     * @return static
41
     */
42
    public function rows(int $rows)
43
    {
44
        return $this->attribute('rows', $rows);
45
    }
46
47
    /**
48
     * @param int $cols
49
     *
50
     * @return static
51
     */
52
    public function cols(int $cols)
53
    {
54
        return $this->attribute('cols', $cols);
55
    }
56
}
57