mirror of
https://github.com/archtechx/enums.git
synced 2025-12-12 18:44:04 +00:00
Use proper type for is and isNot methods
This commit is contained in:
parent
6a0399823f
commit
25f544c451
1 changed files with 3 additions and 2 deletions
|
|
@ -7,15 +7,16 @@ namespace ArchTech\Enums;
|
|||
use Exception;
|
||||
use Iterator;
|
||||
use IteratorAggregate;
|
||||
use UnitEnum;
|
||||
|
||||
trait Comparable
|
||||
{
|
||||
public function is(mixed $enum): bool
|
||||
public function is(UnitEnum $enum): bool
|
||||
{
|
||||
return $this === $enum;
|
||||
}
|
||||
|
||||
public function isNot(mixed $enum): bool
|
||||
public function isNot(UnitEnum $enum): bool
|
||||
{
|
||||
return ! $this->is($enum);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue