Conditions | 4 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
71 | public function handle(Container $container): Container |
||
72 | { |
||
73 | // Execute callback and pass result next chain |
||
74 | if (is_callable($this->callback)) { |
||
75 | $result = call_user_func($this->callback, $container); |
||
76 | |||
77 | if (!$this->next) { |
||
78 | return $result; |
||
79 | } |
||
80 | |||
81 | return $this->next->handle($result); |
||
82 | } |
||
83 | |||
84 | // End of chain |
||
85 | if (!$this->next) { |
||
86 | return $container; |
||
87 | } |
||
88 | |||
89 | // Execute next chain |
||
90 | return $this->next->handle($container); |
||
91 | } |
||
92 | } |
||
93 |