Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| GameFileMetadata | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AqwSocketClient\Objects; |
| 6 | |
| 7 | use Psl; |
| 8 | use Psl\Str; |
| 9 | use Psl\Type; |
| 10 | |
| 11 | final readonly class GameFileMetadata |
| 12 | { |
| 13 | public function __construct( |
| 14 | public readonly string $link, |
| 15 | public readonly string $file, |
| 16 | ) { |
| 17 | Type\non_empty_string()->assert($this->link); |
| 18 | Type\non_empty_string()->assert($this->file); |
| 19 | Psl\invariant(Str\ends_with($this->file, '.swf'), 'The game file must be a .swf file, got "%s".', $this->file); |
| 20 | } |
| 21 | } |