Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
22 | public function __construct(string $uniqid, ?Closure $canceller = null, ?callable $cleanup = null) /** @phpstan-ignore-line */ |
||
23 | { |
||
24 | if ($canceller !== null) { |
||
25 | $canceller = Closure::bind($canceller, $this, self::class); |
||
26 | } |
||
27 | |||
28 | 4 | $this->uniqid = $uniqid; |
|
29 | $this->deferred = new Deferred($canceller); |
||
30 | 4 | ||
31 | 3 | if (! is_callable($cleanup)) { |
|
32 | $cleanup = static function (): void { |
||
33 | }; |
||
34 | 4 | } |
|
35 | 4 | ||
36 | $this->cleanup = $cleanup; |
||
37 | 4 | } |
|
74 |