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

Select   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 70.59%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
lcom 1
cbo 2
dl 0
loc 57
ccs 12
cts 17
cp 0.7059
rs 10
c 1
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getTag() 0 4 1
A init() 0 6 1
A getOptions() 0 4 1
A setOptions() 0 5 1
A getOption() 0 4 1
A setOption() 0 5 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
}