mirror of
https://github.com/archtechx/enums.git
synced 2025-12-12 15:54:04 +00:00
Added "Invokable Cases" PHPStan extension testing
This commit is contained in:
parent
7e6914a52f
commit
72103f9eaf
6 changed files with 226 additions and 0 deletions
26
tests/PHPStan/InvokableCases/Status.php
Normal file
26
tests/PHPStan/InvokableCases/Status.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ArchTech\Enums\Tests\PHPStan\InvokableCases;
|
||||
|
||||
use ArchTech\Enums\InvokableCases;
|
||||
|
||||
enum Status: int
|
||||
{
|
||||
use InvokableCases;
|
||||
|
||||
case created = 0;
|
||||
case running = 1;
|
||||
case done = 2;
|
||||
|
||||
public static function initial(): self
|
||||
{
|
||||
return self::created;
|
||||
}
|
||||
|
||||
public function isStarted(): bool
|
||||
{
|
||||
return $this->value > self::created->value;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue