Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
6 / 6
CRAP
100.00% covered (success)
100.00%
1 / 1
Textarea
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
6 / 6
7
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
2
 name
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 rows
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 cols
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 placeholder
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 required
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Epic64\Elem\Elements;
6
7use Epic64\Elem\Element;
8
9class Textarea extends Element
10{
11    public function __construct(?string $name = null, ?string $content = null)
12    {
13        parent::__construct('textarea', $content);
14        if ($name !== null) {
15            $this->element->setAttribute('name', $name);
16        }
17    }
18
19    public function name(string $name): static
20    {
21        return $this->attr('name', $name);
22    }
23
24    public function rows(int $rows): static
25    {
26        return $this->attr('rows', (string)$rows);
27    }
28
29    public function cols(int $cols): static
30    {
31        return $this->attr('cols', (string)$cols);
32    }
33
34    public function placeholder(string $placeholder): static
35    {
36        return $this->attr('placeholder', $placeholder);
37    }
38
39    public function required(): static
40    {
41        return $this->attr('required', 'required');
42    }
43}