protected function prepareArguments($reflection_parameter, $arguments) {
		$array_type = $this->getArrayType($arguments);
		$prepared = array();

		if ($array_type == self::ARRAY_TYPE_LIST) {
			$prepared = $arguments;
		} elseif ($array_type == self::ARRAY_TYPE_DICT) {
			foreach ($reflection_parameter as $parameter) {
				$name = $parameter->getName();

				if (isset($arguments[$name])) {
					$value = $arguments[$name];
				} else if ($parameter->isDefaultValueAvailable()) {
					$value = $parameter->getDefaultValue();
				} else {
					throw new InvalidParameterException("Missing parameter '$name' on position {$parameter->getPosition()}");
				}

				$prepared[] = $value;
			}
		} else {
			throw new InvalidParameterException('Unable to handle mixed arrays');
		}

		return $prepared;
	}