TextareaField::rows()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace ArgentCrusade\Forms\Fields;
4
5
use ArgentCrusade\Forms\FormField;
6
7
class TextareaField extends FormField
8
{
9
    protected $type = 'textarea';
10
11
    /**
12
     * Set rows count.
13
     *
14
     * @param int $rows
15
     *
16
     * @return TextareaField
17
     */
18
    public function withRows(int $rows)
19
    {
20
        return $this->withAttribute('rows', $rows);
21
    }
22
23
    /**
24
     * Get rows count.
25
     *
26
     * @return int|null
27
     */
28
    public function rows()
29
    {
30
        return $this->getAttribute('rows');
31
    }
32
33
    /**
34
     * Set columns count.
35
     *
36
     * @param int $cols
37
     *
38
     * @return TextareaField
39
     */
40
    public function withCols(int $cols)
41
    {
42
        return $this->withAttribute('cols', $cols);
43
    }
44
45
    /**
46
     * Get columns count.
47
     *
48
     * @return int|null
49
     */
50
    public function cols()
51
    {
52
        return $this->getAttribute('cols');
53
    }
54
}
55