-
Notifications
You must be signed in to change notification settings - Fork 0
Methods
dvlpr1996 edited this page Apr 24, 2024
·
2 revisions
| # | Method | Description |
|---|---|---|
| 1 | getAll(): array | Generates a list of cases on an enum. |
| 2 | asArray(): array | Returns enum as an associative array. |
| 3 | isPureEnum(): bool | Checks whether the enum is a Pure Enum. |
| 4 | isBackedEnum(): bool | Checks whether the enum is a Backed Enum. |
| 5 | isEmpty(): bool | Checks whether the enum is empty. |
| 6 | randomCase(): object | Returns a random enum case. |
| 7 | values(): array | Returns all enum values. |
| 8 | names(): array | Returns all enum names. |
| 9 | randomValue(): string | int |
| 10 | randomName(): string | Returns a random enum name. |
| 11 | flip(): array | Flips enum name and value. |
| 12 | isValueExists(int | string $value, bool $strict = true): bool |
| 13 | isNameExists(string $name, bool $strict = true): bool | Checks if a name exists in an enum. |
| 14 | getNameFromValue(int | string $value): ?string |
| 15 | toJson(int $flags = 0, int $depth = 512): ?string | Converts enum to JSON. |
| 16 | toXml(): ?string | Converts enum data to XML. |
| 17 | info(): array | Returns information about the enum. |
| 18 | filterValuesByPrefix(int | string $prefix): array |
| 19 | filterNamesByPrefix(string $prefix): array | Filters Backed Enum Name By Prefix. |
| 20 | filterValuesBySuffix(int | string $suffix): array |
| 21 | filterNamesBySuffix(string $suffix): array | Filters Backed Enum Name By Suffix. |
| 22 | isValueIn(array | string |
| 23 | isNotValueIn(array | string |
| 24 | isNameIn(array | string $needle): bool |
| 25 | isNotNameIn(array | string $needle): bool |