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

Health::validate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2.1481

Importance

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