Passed
Push — master ( 2ee0d1...1e8995 )
by Tomasz
03:21
created

Step   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A isAllShardsFinishedProgress() 0 3 1
A __construct() 0 4 1
A replace() 0 3 1
A getShards() 0 3 1
A getState() 0 3 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Aggrego\Domain\Model\ProgressiveBoard\Step;
6
7
use Aggrego\Domain\Model\ProgressiveBoard\Shard\Collection;
8
use Aggrego\Domain\Model\ProgressiveBoard\Shard\FinalItem;
9
10
class Step
11
{
12
    /** @var State */
13
    private $state;
14
15
    /** @var Collection */
16
    private $shards;
17
18
    public function __construct(State $state, Collection $shards)
19
    {
20
        $this->state = $state;
21
        $this->shards = $shards;
22
    }
23
24
    public function getState(): State
25
    {
26
        return $this->state;
27
    }
28
29
    public function replace(FinalItem $finalItem): void
30
    {
31
        $this->shards->replace($finalItem);
32
    }
33
34
    public function getShards(): Collection
35
    {
36
        return $this->shards;
37
    }
38
39
    public function isAllShardsFinishedProgress(): bool
40
    {
41
        return $this->shards->isAllShardsFinishedProgress();
42
    }
43
}
44