Completed
Push — master ( 804716...5e83b7 )
by Tomasz
03:36
created

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