Passed
Push — 2.x ( 5e81a5...d097d1 )
by Aleksei
14:17
created

EmptyReference::hasValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
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 2
cts 2
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
15
    public function getRole(): string
16
    {
17
        return $this->role;
18
    }
19
20
    public function getScope(): array
21
    {
22
        throw new \RuntimeException();
23
    }
24
25 144
    public function hasValue(): bool
26
    {
27 144
        return true;
28
    }
29
30
    public function setValue(mixed $value): void
31
    {
32
        $this->value = $value;
33
    }
34
35 144
    public function getValue(): mixed
36
    {
37 144
        return $this->value;
38
    }
39
}
40