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

ProgressStep::readyToTransformation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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