name){ return $status; } } throw new \ValueError("$name is not a valid value for enum " . self::class ); } public static function fromNameOrValue(int|string $scalar) { if(gettype($scalar) == "integer") { return self::tryFrom($scalar); } else { return self::fromName($scalar); } } }