From 1c0355069b3e394a4e81f9eed80f06e0396178c2 Mon Sep 17 00:00:00 2001 From: Vikas Singh <94953593+vikas020807@users.noreply.github.com> Date: Fri, 15 Mar 2024 06:43:19 +0530 Subject: [PATCH] Replace all instances of 'self' with 'static' (#24) Fixes #22 --- src/IsBackedEnum.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/IsBackedEnum.php b/src/IsBackedEnum.php index 0f2f521..1dc5a61 100644 --- a/src/IsBackedEnum.php +++ b/src/IsBackedEnum.php @@ -25,19 +25,19 @@ protected static function ensureImplementsInterface(): void public static function options(): array { static::ensureImplementsInterface(); - return array_map(fn($enum) => $enum->toArray(), self::cases()); + return array_map(fn($enum) => $enum->toArray(), static::cases()); } public static function names(): array { static::ensureImplementsInterface(); - return array_map(fn($enum) => $enum->name, self::cases()); + return array_map(fn($enum) => $enum->name, static::cases()); } public static function values(): array { static::ensureImplementsInterface(); - return array_map(fn($enum) => $enum->value, self::cases()); + return array_map(fn($enum) => $enum->value, static::cases()); } public static function map(): array @@ -45,7 +45,7 @@ public static function map(): array static::ensureImplementsInterface(); $array = []; - foreach (self::cases() as $enum) { + foreach (static::cases() as $enum) { $array[$enum->value] = $enum->label(); } @@ -55,7 +55,7 @@ public static function map(): array public static function labels(): array { static::ensureImplementsInterface(); - return array_map(fn($enum) => self::labelFor($enum), self::cases()); + return array_map(fn($enum) => static::labelFor($enum), static::cases()); } public static function labelFor(self $value): string