AbstractFunction::addArguments()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Murtukov\PHPCodeGenerator;
6
7
abstract class AbstractFunction extends DependencyAwareGenerator
8
{
9
    public Signature $signature;
10
11 1
    public function getReturnType(): string
12
    {
13 1
        return $this->signature->getReturnType();
14
    }
15
16 2
    public function setReturnType(string $returnType): self
17
    {
18 2
        $this->signature->setReturnType($returnType);
19
20 2
        return $this;
21
    }
22
23 3
    public function getArgument(int $index = 1): ?Argument
24
    {
25 3
        return $this->signature->getArgument($index);
26
    }
27
28 1
    public function removeArgument(int $index): self
29
    {
30 1
        $this->signature->removeArgument($index);
31
32 1
        return $this;
33
    }
34
35 1
    public function removeArguments(): self
36
    {
37 1
        $this->signature->removeArguments();
38
39 1
        return $this;
40
    }
41
42 3
    public function createArgument(string $name, string $type = '', $defaultValue = Argument::NO_PARAM): Argument
43
    {
44 3
        return $this->signature->createArgument($name, $type, $defaultValue);
45
    }
46
47 2
    public function addArgument(string $name, string $type = '', $defaultValue = Argument::NO_PARAM): self
48
    {
49 2
        $this->signature->addArgument($name, $type, $defaultValue);
50
51 2
        return $this;
52
    }
53
54 1
    public function addArguments(string ...$names): self
55
    {
56 1
        $this->signature->addArguments(...$names);
57
58 1
        return $this;
59
    }
60
61 3
    public function add(FunctionMemberInterface $member): self
62
    {
63 3
        $this->signature->add($member);
64
65 3
        return $this;
66
    }
67
68 1
    public function bindVar(string $name, bool $isByReference = false): self
69
    {
70 1
        $this->signature->bindVar($name, $isByReference);
71
72 1
        return $this;
73
    }
74
75 1
    public function bindVars(string ...$names): self
76
    {
77 1
        $this->signature->bindVars(...$names);
78
79 1
        return $this;
80
    }
81
82 1
    public function removeBindVars()
83
    {
84 1
        $this->signature->removeBindVars();
85
86 1
        return $this;
87
    }
88
89 1
    public function isStatic(): bool
90
    {
91 1
        return $this->signature->isStatic;
92
    }
93
94 4
    public function setStatic(): self
95
    {
96 4
        $this->signature->isStatic = true;
97
98 4
        return $this;
99
    }
100
101 1
    public function unsetStatic()
102
    {
103 1
        $this->signature->isStatic = false;
104
105 1
        return $this;
106
    }
107
}
108