ArgumentDescription   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 96
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 0
dl 0
loc 96
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getName() 0 4 1
A getPosition() 0 4 1
A getType() 0 4 1
A isRequired() 0 4 1
A getDefaultValue() 0 4 1
A isScalar() 0 4 1
1
<?php
2
3
namespace ArgumentResolver\Argument;
4
5
class ArgumentDescription
6
{
7
    const TYPE_ARRAY = 'array';
8
    const TYPE_SCALAR = 'scalar';
9
10
    /**
11
     * @var string
12
     */
13
    private $name;
14
15
    /**
16
     * @var int
17
     */
18
    private $position;
19
20
    /**
21
     * @var string
22
     */
23
    private $type;
24
25
    /**
26
     * @var bool
27
     */
28
    private $required;
29
30
    /**
31
     * @var mixed
32
     */
33
    private $defaultValue;
34
35
    /**
36
     * Constructor.
37
     *
38
     * @param string $name
39
     * @param int    $position
40
     * @param string $type
41
     * @param bool   $required
42
     * @param mixed  $defaultValue
43
     */
44
    public function __construct($name, $position, $type, $required, $defaultValue = null)
45
    {
46
        $this->name = $name;
47
        $this->position = $position;
48
        $this->type = $type;
49
        $this->required = $required;
50
        $this->defaultValue = $defaultValue;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getName()
57
    {
58
        return $this->name;
59
    }
60
61
    /**
62
     * @return int
63
     */
64
    public function getPosition()
65
    {
66
        return $this->position;
67
    }
68
69
    /**
70
     * @return string
71
     */
72
    public function getType()
73
    {
74
        return $this->type;
75
    }
76
77
    /**
78
     * @return bool
79
     */
80
    public function isRequired()
81
    {
82
        return $this->required;
83
    }
84
85
    /**
86
     * @return mixed
87
     */
88
    public function getDefaultValue()
89
    {
90
        return $this->defaultValue;
91
    }
92
93
    /**
94
     * @return bool
95
     */
96
    public function isScalar()
97
    {
98
        return self::TYPE_SCALAR === $this->getType();
99
    }
100
}
101