Skip to content

LegacyEnumShimTrait ​

trait · pocketmine\utils\LegacyEnumShimTrait · source

Deprecated

This class is deprecated.

Offers a shim to make a native enum behave similarly to a legacy EnumTrait enum. Used to provide backwards compatibility for enums that have been migrated to native PHP 8.1 enums.

Methods ​

__callStatic() ​

php
public static function __callStatic(string $name, array $arguments) : self

equals() ​

php
public function equals(self $other) : bool

Deprecated

Native enums can be safely compared with ===.

Returns whether the two objects are equivalent.

getAll() ​

php
public static function getAll() : array

Returns a list of all cases, indexed by name.

id() ​

php
public function id() : int

Deprecated

Deprecated.

Alias of spl_object_id($this).

name() ​

php
public function name() : string

Deprecated

Use the native enum's name property instead.

Shim for \UnitEnum::name.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.