/** * @inheritdoc */ public static function getInstance($idOrValue) { try { return parent::getInstance($idOrValue); } catch (EnumException $e) { if (isset(self::$instancesByValues[static::class][$idOrValue])) { return self::$instancesByValues[static::class][$idOrValue]; } throw $e; } }