Textarea   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 12 1
1
<?php
2
3
namespace GeminiLabs\Castor\Forms\Fields;
4
5
class Textarea extends Base
6
{
7
    protected $element = 'textarea';
8
9
    /**
10
     * @return string
11
     */
12
    public function render(array $defaults = [])
13
    {
14
        $defaults = wp_parse_args($defaults, [
15
            'class' => 'large-text',
16
            'rows' => 3,
17
            'type' => 'textarea',
18
        ]);
19
20
        return sprintf('<textarea %s>%s</textarea>%s',
21
            $this->implodeAttributes($defaults),
22
            $this->args['value'],
23
            $this->generateDescription()
24
        );
25
    }
26
}
27