public function asEnum($value, $enumName)
    {
        if (!isset($this->enums[$enumName])) {
            throw new InvalidParamException("The '$enumName' enum has not been registered in the current formatter");
        }
        if ($value === null) {
            return $this->nullDisplay;
        }
        return isset($this->enums[$enumName][$value]) ? $this->enums[$enumName][$value] : $value;
    }