Conditions | 5 |
Paths | 11 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 5.0592 |
Changes | 0 |
1 | <?php |
||
33 | 4 | public function pour(): void |
|
34 | { |
||
35 | 4 | $provider = $this->source->getCask(); |
|
36 | 4 | foreach ($provider as $dataBag) { |
|
37 | 4 | if ($dataBag instanceof \Throwable) { |
|
38 | $this->emitter->emit('provider_error', $dataBag->getMessage()); |
||
39 | continue; |
||
40 | } |
||
41 | try { |
||
42 | 4 | $this->pipeLine->rewind(); |
|
43 | 4 | while ($this->pipeLine->valid()) { |
|
44 | 4 | $handler = $this->pipeLine->current(); |
|
45 | 4 | $dataBag = $handler->pass($dataBag); |
|
46 | 4 | $this->pipeLine->next(); |
|
47 | } |
||
48 | 2 | } catch (FlowTerminationException $exception) { |
|
49 | 4 | $this->emitter->emit('valve_closed', $exception->getIdentifier(), $dataBag); |
|
50 | } |
||
51 | } |
||
52 | 4 | $this->emitter->emit('empty_cask'); |
|
53 | 4 | } |
|
54 | } |
||
55 |