AbstractFunction   A
last analyzed

Complexity

Total Complexity 15

Size/Duplication

Total Lines 99
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 28
dl 0
loc 99
ccs 41
cts 41
cp 1
rs 10
c 3
b 0
f 0
wmc 15

15 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 5 1
A createArgument() 0 3 1
A bindVars() 0 5 1
A removeBindVars() 0 5 1
A addArgument() 0 5 1
A bindVar() 0 5 1
A getArgument() 0 3 1
A removeArgument() 0 5 1
A setStatic() 0 5 1
A removeArguments() 0 5 1
A getReturnType() 0 3 1
A setReturnType() 0 5 1
A isStatic() 0 3 1
A unsetStatic() 0 5 1
A addArguments() 0 5 1
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