Passed
Push — master ( 2978a7...f80fed )
by Nico
21:04 queued 09:57
created

SubspaceData::isDisabled()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 0
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Lib\Map\VisualPanel\Layer\Data;
6
7
use Doctrine\ORM\Mapping\Column;
8
use Doctrine\ORM\Mapping\Entity;
9
use Stu\Lib\Map\FieldTypeEffectEnum;
10
11
#[Entity]
12
class SubspaceData extends AbstractData
13
{
14
    #[Column(type: 'integer')]
15
    private int $d1c = 0;
16
    #[Column(type: 'integer')]
17
    private int $d2c = 0;
18
    #[Column(type: 'integer')]
19
    private int $d3c = 0;
20
    #[Column(type: 'integer')]
21
    private int $d4c = 0;
22
23
    public function getDirection1Count(): int
24
    {
25
        return $this->d1c;
26
    }
27
28
    public function getDirection2Count(): int
29
    {
30
        return $this->d2c;
31
    }
32
33
    public function getDirection3Count(): int
34
    {
35
        return $this->d3c;
36
    }
37
38
    public function getDirection4Count(): int
39
    {
40
        return $this->d4c;
41
    }
42
43
    public function isDisabled(): bool
44
    {
45
        return $this->effects !== null
46
            && in_array(FieldTypeEffectEnum::NO_SUBSPACE_LINES->value, $this->effects);
47
    }
48
}
49