Passed
Push — master ( 954430...fcf71b )
by Paweł
02:57
created

Health   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 6
ccs 2
cts 3
cp 0.6667
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 4 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AardsGerds\Game\Build\Attribute;
6
7
use AardsGerds\Game\Shared\IntegerValue;
8
use AardsGerds\Game\Shared\IntegerValueException;
9
10
final class Health extends IntegerValue
11
{
12 5
    protected function validate(): void
13
    {
14 5
        if ($this->value < 1) {
15
            throw IntegerValueException::invalidValue($this->value);
16
        }
17 5
    }
18
}
19