protected function getDependencies(\ReflectionMethod $method)
    {
        $dependencies = array();

        foreach ($method->getParameters() as $param) {
            $dependency = $param->getClass();

            if (is_null($dependency)) {
                if ($param->isOptional()) {
                    $dependencies[] = $param->getDefaultValue();
                    continue;
                }
            } else {
                $dependencies[] = $this->resolve($dependency->name);
                continue;
            }

            throw new \InvalidArgumentException('Could not resolve ' . $param->getName());
        }

        return $dependencies;
    }