Failed Conditions
Pull Request — 0.3 (#20)
by jean
03:05
created

ChainProcessNotifier::add()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Darkilliant\ProcessBundle\ProcessNotifier;
4
5
use Darkilliant\ProcessBundle\State\ProcessState;
6
use Darkilliant\ProcessBundle\Step\StepInterface;
7
8
class ChainProcessNotifier implements ProcessNotifierInterface
9
{
10
    /** @var ProcessNotifierInterface[] */
11
    private $notifiers = [];
12
13 5
    public function add(ProcessNotifierInterface $notifier)
14
    {
15 5
        $this->notifiers[] = $notifier;
16 5
    }
17
18 1
    public function onExecutedProcess(ProcessState $state, StepInterface $step)
19
    {
20 1
        foreach ($this->notifiers as $notifier) {
21 1
            $notifier->onExecutedProcess($state, $step);
22
        }
23 1
    }
24
25 1
    public function onStartProcess(ProcessState $state, StepInterface $step)
26
    {
27 1
        foreach ($this->notifiers as $notifier) {
28 1
            $notifier->onStartProcess($state, $step);
29
        }
30 1
    }
31
32 1
    public function onEndProcess(ProcessState $state, StepInterface $step)
33
    {
34 1
        foreach ($this->notifiers as $notifier) {
35 1
            $notifier->onEndProcess($state, $step);
36
        }
37 1
    }
38
39 1
    public function onStartIterableProcess(ProcessState $state, StepInterface $step)
40
    {
41 1
        foreach ($this->notifiers as $notifier) {
42 1
            $notifier->onStartIterableProcess($state, $step);
43
        }
44 1
    }
45
46 1
    public function onUpdateIterableProcess(ProcessState $state, StepInterface $step)
47
    {
48 1
        foreach ($this->notifiers as $notifier) {
49 1
            $notifier->onUpdateIterableProcess($state, $step);
50
        }
51 1
    }
52
}
53