EmptyReference::getValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
c 1
b 0
f 0
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