1
0
Fork 0
mirror of https://github.com/archtechx/enums.git synced 2025-12-12 20:04:03 +00:00

Use proper type for is and isNot methods

This commit is contained in:
Mark 2024-12-29 07:43:15 +01:00
parent 6a0399823f
commit 25f544c451
No known key found for this signature in database
GPG key ID: 79CFF7869BD39873

View file

@ -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);
}