Lines
0.00%
0 / 3
Functions and Methods
0.00%
0 / 3
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ScanPage | 0.00% | 0 / 3 | 0.00% | 0 / 3 | 12 | 0.00% | 0 / 1 | |||
| __construct | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| isLast | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| fromReply | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Store\Redis; | |
| 6 | ||
| 7 | final readonly class ScanPage | |
| 8 | { | |
| 9 | /** @param list<string> $keys */ | |
| 10 | public function __construct( | |
| 11 | public string $cursor, | |
| 12 | public array $keys, | |
| 13 | ) {} | |
| 14 | ||
| 15 | public function isLast(): bool | |
| 16 | { | |
| 17 | return $this->cursor === '0'; | |
| 18 | } | |
| 19 | ||
| 20 | public static function fromReply(mixed $reply): self | |
| 21 | { | |
| 22 | /** @var array{string, list<string>} $reply */ | |
| 23 | return new self($reply[0], $reply[1]); | |
| 24 | } | |
| 25 | } |