Passed
Push — master ( 812b31...82efe3 )
by Paweł
02:52
created

Health   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
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 8
    protected function validate(): void
13
    {
14 8
        if ($this->value < 1) {
15 3
            throw IntegerValueException::invalidValue($this->value);
16
        }
17 8
    }
18
}
19