Total Complexity | 2 |
Total Lines | 15 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | final class UnresolvedMatchSubject extends MatchSubject |
||
11 | { |
||
12 | public function case(Pattern $pattern, callable $handler): MatchSubject |
||
13 | { |
||
14 | return $pattern |
||
15 | ->match($this->get()) |
||
16 | ->fold( |
||
17 | function (): MatchSubject { return $this; }, |
||
18 | function ($result) use ($handler): MatchSubject { return new ResolvedMatchSubject($handler(...$result)); } |
||
19 | ); |
||
20 | } |
||
21 | |||
22 | public function done(): void |
||
25 | } |
||
26 | } |
||
27 |