Conditions | 6 |
Paths | 9 |
Total Lines | 21 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
21 | public function append(Closure $result, bool $isLastResult = false, bool $isContinue = false): self |
||
22 | { |
||
23 | if (!$this->isException || $this->isContinue) { |
||
24 | $this->isContinue = $isContinue; |
||
25 | |||
26 | try { |
||
27 | $this->result = $result($this->result); |
||
28 | } catch (Exception $exception) { |
||
29 | $this->result = Handler::renderException($exception); |
||
30 | } |
||
31 | |||
32 | if ($isLastResult) { |
||
33 | $this->lastResult = $this->result; |
||
34 | } |
||
35 | |||
36 | if (!$this->result->isContinue()) { |
||
37 | $this->isException = true; |
||
38 | } |
||
39 | } |
||
40 | |||
41 | return $this; |
||
42 | } |
||
53 |