Total Complexity | 4 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class ServiceEnclosure implements ServiceEnclosureInterface |
||
9 | { |
||
10 | protected object $saved; |
||
11 | |||
12 | protected Closure $enclosure; |
||
13 | |||
14 | public function __construct(callable $factory) |
||
17 | } |
||
18 | |||
19 | public function reveal(): Closure |
||
22 | } |
||
23 | |||
24 | protected function buildEnclosure(callable $factory): Closure |
||
25 | { |
||
26 | return fn () => $this->saved ??= ($factory)(...func_get_args()); |
||
27 | } |
||
28 | |||
29 | public static function enclose(callable $factory): Closure |
||
34 | } |
||
35 | } |
||
36 |