Skip to content

Commit de7ba12

Browse files
Extended the EnumInterface with the comparison methods
1 parent 202c1a8 commit de7ba12

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Changelog.md

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
###### 2024-XX-YY
77

88
- Added the `isAnyOf()`, `isNoneOf()` and `doesNotEqualTo()` comparison methods
9+
- Added the following methods to the `EnumInterface`:
10+
- `equals()`
11+
- `doesNotEqualTo()`
12+
- `isAnyOf()`
13+
- `isNoneOf()`
914

1015
## 4.1.0
1116
###### 2023-06-07

src/EnumInterface.php

+8
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,13 @@ public static function choices(): array;
2828

2929
public static function defaultValue(): mixed;
3030

31+
public function equals(object $object): bool;
32+
33+
public function doesNotEqualTo(EnumInterface $enum): bool;
34+
35+
public function isAnyOf(EnumInterface ...$enums): bool;
36+
37+
public function isNoneOf(EnumInterface ...$enums): bool;
38+
3139
public static function create($value = null): static;
3240
}

0 commit comments

Comments
 (0)