Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
GameFileMetadata
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace AqwSocketClient\Objects;
6
7use Psl;
8use Psl\Str;
9use Psl\Type;
10
11final 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}