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

Health::validate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

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