Skip to content

Commit

Permalink
Replace all instances of 'self' with 'static' (#24)
Browse files Browse the repository at this point in the history
Fixes #22
  • Loading branch information
vikas020807 authored Mar 15, 2024
1 parent 039dc0f commit 1c03550
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/IsBackedEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@ 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
{
static::ensureImplementsInterface();
$array = [];

foreach (self::cases() as $enum) {
foreach (static::cases() as $enum) {
$array[$enum->value] = $enum->label();
}

Expand All @@ -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
Expand Down

0 comments on commit 1c03550

Please sign in to comment.