Completed
Push — master ( 3c5c0f...ec5ff6 )
by Laurent
01:40
created

InputTextarea::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 *
4
 */
5
6
namespace flightlog\form;
7
8
use Webmozart\Assert\Assert;
9
10
/**
11
 * @author Laurent De Coninck <[email protected]>
12
 */
13
class InputTextarea extends BaseInput
14
{
15
    /**
16
     * @param string $name
17
     * @param array  $options
18
     */
19
    public function __construct($name, array $options = [])
20
    {
21
        parent::__construct($name, FormElementInterface::TYPE_TEXTAREA, $options);
22
    }
23
24
    /**
25
     * @param int $number
26
     *
27
     * @return $this
28
     */
29
    public function col($number)
30
    {
31
        Assert::integer($number);
32
33
        $this->setAttribute('cols', $number);
34
35
        return $this;
36
    }
37
38
    /**
39
     * @param int $number
40
     *
41
     * @return $this
42
     */
43
    public function row($number)
44
    {
45
        Assert::integer($number);
46
47
        $this->setAttribute('rows', $number);
48
49
        return $this;
50
    }
51
}