Completed
Branch dev-master (5a9550)
by Derek Stephen
02:00
created

Select::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * User: delboy1978uk
4
 * Date: 05/12/2016
5
 * Time: 00:57
6
 */
7
8
namespace Del\Form\Field;
9
10
use Del\Form\Renderer\Field\SelectRender;
11
12
class Select extends FieldAbstract
13
{
14
    /** @var array $options */
15
    private $options = [];
16
17
    /**
18
     * @return string
19
     */
20 1
    public function getTag()
21
    {
22 1
        return 'select';
23
    }
24
25
26 1
    public function init()
27
    {
28 1
        $this->setAttribute('type', 'text');
29 1
        $this->setAttribute('class', 'form-control');
30 1
        $this->setRenderer(new SelectRender());
31 1
    }
32
33
    /**
34
     * @return array
35
     */
36 1
    public function getOptions()
37
    {
38 1
        return $this->options;
39
    }
40
41
    /**
42
     * @param array $options
43
     * @return $this
44
     */
45
    public function setOptions($options)
46
    {
47
        $this->options = $options;
48
        return $this;
49
    }
50
51
    /**
52
     * @return array
53
     */
54
    public function getOption($key)
55
    {
56
        return $this->options[$key];
57
    }
58
59
    /**
60
     * @param array $options
0 ignored issues
show
Bug introduced by
There is no parameter named $options. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
61
     * @return $this
62
     */
63 1
    public function setOption($key, $value)
64
    {
65 1
        $this->options[$key] = $value;
66 1
        return $this;
67
    }
68
}