protected function validateEnum($value, $parsedValue)
    {
        $return = new ValidateResult($parsedValue, false);

        //Check if $this->enum is set and it's not null since its optional
        if ($this->enum !== null) {
            if (is_object($value)) {
                throw new \Exception('Objects are not supported');
            }

            //Search current $value in enum
            foreach ($this->enum as $v) {
                if (is_object($v)) {
                    throw new \Exception('Objects are not supported');
                }

                if ($value == $v) {
                    if ($this->validateType && ($valueType = gettype($value)) !== ($vType = gettype($v))) {
                        continue;
                    }

                    //Success value is found

                    //Overwrite $return's value (get correct object type)
                    $return->value = $v;

                    //Set status to true
                    $return->status = true;

                    return $return;
                } elseif (is_array($value)
                    && is_array($v)
                    && ArrayValidator::equals($value, $v)
                ) {
                    //Type is same (arrays)
                    //Success value is found

                    //Overwrite $return's value (get correct object type)
                    $return->value = $v;

                    //Set status to true
                    $return->status = true;

                    return $return;
                }
            }

            $return->status = false;
            //Error
            $return->errorObject = new IncorrectParametersException([[
                'type' => static::getType(),
                'failure' => 'enum'
            ]]);
        }

        return $return;
    }