Select::render()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 10
rs 10
1
<?php
2
3
namespace GeminiLabs\Castor\Forms\Fields;
4
5
class Select extends Base
6
{
7
    protected $element = 'select';
8
9
    /**
10
     * @return string
11
     */
12
    public function render(array $defaults = [])
13
    {
14
        $defaults = wp_parse_args($defaults, [
15
            'type' => 'select',
16
        ]);
17
18
        return sprintf('<select %s>%s</select>%s',
19
            $this->implodeAttributes($defaults),
20
            $this->implodeOptions('select_option'),
21
            $this->generateDescription()
22
        );
23
    }
24
}
25