Skip to content

Commit

Permalink
replace self with static
Browse files Browse the repository at this point in the history
  • Loading branch information
vikas020807 committed Mar 12, 2024
1 parent 8261944 commit 3018d6f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/IsBackedEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static function labels(): array
return array_map(fn($enum) => static::getLabel($enum->name), static::cases());
}

public static function labelFor(static $value): string
public static function labelFor(self $value): string
{
static::ensureImplementsInterface();
$lang_key = sprintf(
Expand Down Expand Up @@ -118,19 +118,19 @@ public function toJson($options = 0): string
return $json;
}

public function is(string|static $value): bool
public function is(string|self $value): bool
{
static::ensureImplementsInterface();
return $this->isAny([$value]);
}

public function isA(string|static $value): bool
public function isA(string|self $value): bool
{
static::ensureImplementsInterface();
return $this->is($value);
}

public function isAn(string|static $value): bool
public function isAn(string|self $value): bool
{
static::ensureImplementsInterface();
return $this->is($value);
Expand All @@ -148,19 +148,19 @@ public function isAny(array $values): bool
return in_array($this, $values);
}

public function isNot(string|static $value): bool
public function isNot(string|self $value): bool
{
static::ensureImplementsInterface();
return !$this->isAny([$value]);
}

public function isNotA(string|static $value): bool
public function isNotA(string|self $value): bool
{
static::ensureImplementsInterface();
return $this->isNot($value);
}

public function isNotAn(string|static $value): bool
public function isNotAn(string|self $value): bool
{
static::ensureImplementsInterface();
return $this->isNot($value);
Expand Down

0 comments on commit 3018d6f

Please sign in to comment.