Skip to content

Methods

dvlpr1996 edited this page May 13, 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 Returns a random enum value.
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 Checks if a value exists in an enum.
13 isNameExists(string $name, bool $strict = true): bool Checks if a name exists in an enum.
14 getNameFromValue(int|string $value): ?string Gets the enum name with the enum value.
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 Filters Backed Enum Value By Prefix.
19 filterNamesByPrefix(string $prefix): array Filters Backed Enum Name By Prefix.
20 filterValuesBySuffix(int|string $suffix): array Filters Backed Enum Values By Suffix.
21 filterNamesBySuffix(string $suffix): array Filters Backed Enum Name By Suffix.
22 isValueIn(array|string|int $needle): bool Checks Whether The Needle Is In The Values.
23 isNotValueIn(array|string|int $needle): bool Checks Whether The Needle Is Not In The Values.
24 isNameIn(array|string $needle): bool Checks Whether The Needle Is In The Names.
25 isNotNameIn(array|string $needle): bool Checks Whether The Needle Is Not In The Names.
Clone this wiki locally