protected function _getMethodParameters(
        MethodInjection $method = null,
        ReflectionMethod $methodReflection = null,
        array $parameters = []
    ) {
        $args = [];
        if ($methodReflection) {
            foreach ($methodReflection->getParameters() as $index => $parameter) {
                if (array_key_exists($parameter->getName(), $parameters)) {
                    $value = $parameters[$parameter->getName()];
                } elseif ($method && $method->hasParameter($index)) {
                    $value = $method->getParameter($index);
                } else {
                    // If the parameter is optional and wasn't specified,
                    // we take its default value
                    if ($parameter->isOptional()) {
                        $args[] = $this->_getParameterDefaultValue(
                            $parameter,
                            $methodReflection
                        );
                        continue;
                    }

                    throw new DefinitionException(sprintf(
                        "The parameter '%s' of %s::%s has no value defined " .
                        "or guessable",
                        $parameter->getName(),
                        $methodReflection->getDeclaringClass()->getName(),
                        $methodReflection->getName()
                    ));
                }

                if ($value instanceof ObjectDefinition\EntryReference) {
                    $args[] = $this->_container->get($value->getName());
                } else {
                    $args[] = $value;
                }
            }
        }
        return $args;
    }