Passed
Pull Request — main (#8)
by Alex
02:23
created

Description::fromValue()   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 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace StraTDeS\VO\Single;
4
5
class Description
6
{
7
    private string $value;
8
9 5
    private function __construct(string $value)
10
    {
11 5
        $this->value = $value;
12 5
    }
13
14 5
    public static function fromValue(string $value): Description
15
    {
16 5
        return new Description($value);
17
    }
18
19 1
    public function value(): string
20
    {
21 1
        return $this->value;
22
    }
23
24 2
    public function equal(Description $description): bool
25
    {
26 2
        return $this->value == $description->value;
27
    }
28
}
29