DefaultValueTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 23
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setDefaultValue() 0 7 1
A hasDefaultValue() 0 4 1
A getDefaultValue() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace Igni\Utils\ReflectionApi;
4
5
trait DefaultValueTrait
6
{
7
    private $defaultValue = null;
8
    private $hasDefaultValue = false;
9
10 1
    public function setDefaultValue($value): self
11
    {
12 1
        $this->defaultValue = $value;
13 1
        $this->hasDefaultValue = true;
14
15 1
        return $this;
16
    }
17
18 3
    public function hasDefaultValue(): bool
19
    {
20 3
        return $this->hasDefaultValue;
21
    }
22
23 1
    public function getDefaultValue()
24
    {
25 1
        return $this->defaultValue;
26
    }
27
}
28