ReflectedArgument::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 6
rs 9.4286
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
3
/*
4
 * (c) Jean-François Lépine <https://twitter.com/Halleck45>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Hal\Component\OOP\Reflected;
11
12
13
/**
14
 * Result (argument)
15
 *
16
 * @author Jean-François Lépine <https://twitter.com/Halleck45>
17
 */
18
class ReflectedArgument {
19
20
    /**
21
     * @var string
22
     */
23
    private $name;
24
25
    /**
26
     * @var string
27
     */
28
    private $type;
29
30
    /**
31
     * @var bool
32
     */
33
    private $isRequired;
34
35
    /**
36
     * Constructor
37
     *
38
     * @param string $name
39
     * @param string $type
40
     * @param bool $isRequired
41
     */
42
    public function __construct($name, $type, $isRequired = false)
43
    {
44
        $this->name = (string) $name;
45
        $this->isRequired = (bool) $isRequired;
46
        $this->type = (string) $type;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getName()
53
    {
54
        return $this->name;
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function getType()
61
    {
62
        return $this->type;
63
    }
64
65
    /**
66
     * @return bool
67
     */
68
    public function isRequired() {
69
        return $this->isRequired;
70
    }
71
};