Lines 100.00% 7 / 7
Methods 100.00% 4 / 4
Classes 100.00% 1 / 1
Name Lines Methods CRAP
 demandedIn 100.00% 4 / 4 100.00% 1 / 1 2
 [Lorekeeper\Core\Support\NonEmptyString] __construct 100.00% 1 / 1 100.00% 1 / 1 1
 [Lorekeeper\Core\Support\NonEmptyString] equals 100.00% 1 / 1 100.00% 1 / 1 2
 [Lorekeeper\Core\Support\NonEmptyString] __toString 100.00% 1 / 1 100.00% 1 / 1 1
9final readonly class ClientVersion extends NonEmptyString
10{
11    public static function demandedIn(string $refusal): ?self
12    {
13        $found = [];
14        if (preg_match('/game version (\d+(?:\.\d+)+)/i', $refusal, $found) !== 1) {
15            return null;
16        }
17
18        return new self($found[1]);
19    }
20}

Inherited from Lorekeeper\Core\Support\NonEmptyString

19    final public function __construct(string $value)
20    {
21        $this->value = Type\non_empty_string()->assert($value);
22    }
29    final public function equals(mixed $other): bool
30    {
31        return $other instanceof static && $other->value === $this->value;
32    }
34    final public function __toString(): string
35    {
36        return $this->value;
37    }