private function getCreateServiceDefinitionFromCallable($decoratedServiceName, $serviceName, $serviceProviderKey, callable $callable, ContainerDefinition $containerDefinition): DumpableInterface
    {
        if ($callable instanceof DefinitionInterface) {
            return $this->converter->convert($decoratedServiceName, $callable);
        }
        if (is_array($callable) && is_string($callable[0])) {
            return new FactoryCallDefinition($decoratedServiceName, $callable[0], $callable[1], [$containerDefinition]);
        } elseif (is_string($callable) && strpos($callable, '::') !== false) {
            $pos = strpos($callable, '::');
            $className = substr($callable, 0, $pos);
            $methodName = substr($callable, $pos + 2);

            return new FactoryCallDefinition($decoratedServiceName, $className, $methodName, [$containerDefinition]);
        }

        // This is an object or a callback... we need to call the getServices method of the service provider at runtime.
        return new CreateServiceFromRegistryDefinition($decoratedServiceName, $serviceName, $serviceProviderKey);
    }
private function getCreateServiceDefinitionFromCallable($decoratedServiceName, $serviceName, $serviceProviderKey, callable $callable, ContainerDefinition $containerDefinition): DumpableInterface
    {
        if ($callable instanceof DefinitionInterface) {
            return $this->converter->convert($decoratedServiceName, $callable);
        }
        if (is_array($callable) && is_string($callable[0])) {
            return new FactoryCallDefinition($decoratedServiceName, $callable[0], $callable[1], [$containerDefinition]);
        } elseif (is_string($callable) && strpos($callable, '::') !== false) {
            $pos = strpos($callable, '::');
            $className = substr($callable, 0, $pos);
            $methodName = substr($callable, $pos + 2);

            return new FactoryCallDefinition($decoratedServiceName, $className, $methodName, [$containerDefinition]);
        }

        // This is an object or a callback... we need to call the getServices method of the service provider at runtime.
        return new CreateServiceFromRegistryDefinition($decoratedServiceName, $serviceName, $serviceProviderKey);
    }
@param $serviceName
@param int                            $serviceProviderKey
@param callable                       $callable
@param ContainerDefinition            $containerDefinition

@return DumpableInterface