EmptyReference   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 40%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 30
ccs 4
cts 10
cp 0.4
rs 10
c 1
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getScope() 0 3 1
A setValue() 0 3 1
A getValue() 0 3 1
A getRole() 0 3 1
A hasValue() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cycle\ORM\Reference;
6
7
final class EmptyReference implements ReferenceInterface
8
{
9 168
    public function __construct(
10
        private string $role,
11
        private mixed $value,
12
    ) {}
13
14
    public function getRole(): string
15
    {
16
        return $this->role;
17
    }
18
19
    public function getScope(): array
20
    {
21
        throw new \RuntimeException();
22
    }
23
24
    public function hasValue(): bool
25 144
    {
26
        return true;
27 144
    }
28
29
    public function setValue(mixed $value): void
30
    {
31
        $this->value = $value;
32
    }
33
34
    public function getValue(): mixed
35 144
    {
36
        return $this->value;
37 144
    }
38
}
39