Lines
80.00%
4 / 5
Methods
80.00%
4 / 5
Classes
0.00%
0 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| createUnique | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| unsubscribe | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| isActive | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| getId | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| 10 | final readonly class CancelledSubscription implements Subscription | |
| 11 | { | |
| 12 | private function __construct(private string $id) {} | |
| 13 | ||
| 14 | public static function createUnique(): self | |
| 15 | { | |
| 16 | return new self('cancelled:' . bin2hex(random_bytes(8))); | |
| 17 | } | |
| 18 | ||
| 19 | public function unsubscribe(): void {} | |
| 20 | ||
| 21 | public function isActive(): bool | |
| 22 | { | |
| 23 | return false; | |
| 24 | } | |
| 25 | ||
| 26 | public function getId(): string | |
| 27 | { | |
| 28 | return $this->id; | |
| 29 | } | |
| 30 | } |