Passed
Push — master ( de3770...e18c28 )
by Petr
07:43
created

Cut   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 11
c 0
b 0
f 0
dl 0
loc 39
ccs 11
cts 11
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getBitwiseBlock() 0 3 1
A getBitsInAffectedPart() 0 3 1
A setData() 0 6 1
A getAddress() 0 3 1
1
<?php
2
3
namespace kalanis\kw_bans\Bans;
4
5
6
class Cut
7
{
8
    /** @var array<int, string> */
9
    protected $useAddress = [];
10
    /** @var string */
11
    protected $bitwiseBlock;
12
    /** @var int */
13
    protected $bitsInAffectedPart = 0;
14
15
    /**
16
     * @param array<int, string> $useAddress
17
     * @param string $bitwiseBlock
18
     * @param int $bitsInAffectedPart
19
     * @return $this
20
     */
21 16
    public function setData(array $useAddress, string $bitwiseBlock, int $bitsInAffectedPart): self
22
    {
23 16
        $this->useAddress = $useAddress;
24 16
        $this->bitwiseBlock = $bitwiseBlock;
25 16
        $this->bitsInAffectedPart = $bitsInAffectedPart;
26 16
        return $this;
27
    }
28
29
    /**
30
     * @return array<int, string>
31
     */
32 16
    public function getAddress(): array
33
    {
34 16
        return $this->useAddress;
35
    }
36
37 4
    public function getBitwiseBlock(): string
38
    {
39 4
        return $this->bitwiseBlock;
40
    }
41
42 9
    public function getBitsInAffectedPart(): int
43
    {
44 9
        return $this->bitsInAffectedPart;
45
    }
46
}
47