Passed
Push — develop ( 45600c...ff69f6 )
by Paul
03:16
created

FunctionModel::getParent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace PhpUnitGen\Model;
4
5
use PhpUnitGen\Model\ModelInterface\FunctionModelInterface;
6
use PhpUnitGen\Model\ModelInterface\ParameterModelInterface;
7
use PhpUnitGen\Model\PropertyInterface\ParentInterface;
8
use PhpUnitGen\Model\PropertyTrait\AbstractTrait;
9
use PhpUnitGen\Model\PropertyTrait\FinalTrait;
10
use PhpUnitGen\Model\PropertyTrait\NamespaceTrait;
11
use PhpUnitGen\Model\PropertyTrait\NameTrait;
12
use PhpUnitGen\Model\PropertyTrait\StaticTrait;
13
use PhpUnitGen\Model\PropertyTrait\VisibilityTrait;
14
15
/**
16
 * Class FunctionModel.
17
 *
18
 * @author     Paul Thébaud <[email protected]>.
19
 * @copyright  2017-2018 Paul Thébaud <[email protected]>.
20
 * @license    https://opensource.org/licenses/MIT The MIT license.
21
 * @link       https://github.com/paul-thebaud/phpunit-generator
22
 * @since      Class available since Release 2.0.0.
23
 */
24
class FunctionModel implements FunctionModelInterface
25
{
26
    use NamespaceTrait;
27
    use NameTrait;
28
    use VisibilityTrait;
29
    use StaticTrait;
30
    use FinalTrait;
31
    use AbstractTrait;
32
33
    /**
34
     * @var ParentInterface|null $parent The parent which contains this function.
35
     */
36
    private $parent;
37
38
    /**
39
     * @var ParameterModel[] $parameters The function methods.
40
     */
41
    private $parameters = [];
42
43
    /**
44
     * @var ReturnModel $return The function return.
45
     */
46
    private $return;
0 ignored issues
show
introduced by
The private property $return is not used, and could be removed.
Loading history...
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function setParent(?ParentInterface $parent): void
52
    {
53
        $this->parent = $parent;
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function getParent(): ?ParentInterface
60
    {
61
        return $this->parent;
62
    }
63
64
    /**
65
     * {@inheritdoc}
66
     */
67
    public function addParameter(ParameterModelInterface $parameter): void
68
    {
69
        $this->parameters[] = $parameter;
70
    }
71
72
    /**
73
     * {@inheritdoc}
74
     */
75
    public function getParameters(): array
76
    {
77
        return $this->parameters;
78
    }
79
}
80