1
0
Fork 0
mirror of https://github.com/archtechx/enums.git synced 2025-12-12 08:04:04 +00:00
enums/tests/PHPStan/InvokableCases/Suits.php

30 lines
523 B
PHP

<?php
declare(strict_types=1);
namespace ArchTech\Enums\Tests\PHPStan\InvokableCases;
use ArchTech\Enums\InvokableCases;
enum Suits: string
{
use InvokableCases;
case clubs = 'C';
case diamonds = 'D';
case hearts = 'H';
case spades = 'S';
public static function valuable(): self
{
return self::diamonds;
}
public function isRed(): bool
{
return match ($this) {
self::diamonds, self::hearts => true,
default => false,
};
}
}