protected function parse(array $definitions)
    {
        foreach ($this->rawParams as $rKey => $rVal) {
            if (array_key_exists($rKey, $definitions)) {
                if (is_array($rVal)) {
                    $value = array();

                    foreach ($rVal as $key => $val) {
                        $value[$key] = $this->validateValue($val, $definitions[$rKey]);
                    }
                } else {
                    $value = $this->validateValue($rVal, $definitions[$rKey]);
                }

                $this->parsedParams[$rKey] = $value;
                unset($this->rawParams[$rKey]);

                if ($definitions[$rKey]->getIsRequired()) {
                    unset($this->requiredParams[array_search($rKey, $this->requiredParams)]);
                }
            }
        }

        $this->handleUndefinedParameters();
        $this->handleMissingRequiredParameters();
    }