Can the factory create an instance for the service?

@param  ContainerInterface $container
@param  string $requestedName
@return bool
552395
public function canCreate(ContainerInterface $container, $requestedName)
    {
        $config = $this->getConfig($container);

        return isset($config[$requestedName]);
    }
1206654
private function createProxy($className, callable $serviceFactory, Container $app)
    {
        return $this->proxyFactory->createProxy(
            $className,
            function (&$wrappedObject, $proxy, $method, $parameters, &$initializer) use (
                $className,
                $serviceFactory,
                $app
            ) {
                $wrappedObject = $serviceFactory($app);
                $initializer = null;
                return true;
            }
        );
    }
314314
public function withContainer(ContainerInterface $container): ContainerizedInterface
    {
        $route = clone $this;
        $route->container = $container;
        if ($route->target instanceof TargetInterface) {
            $route->target = clone $route->target;
        }

        $route->pipeline = $route->makePipeline();

        return $route;
    }
515367
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $allConfigs = $this->getConfig($serviceLocator);
        $config = $allConfigs[$requestedName];
        $httpClient = new HttpClient();
        if (isset($config['http_client_options'])) {
            $httpClient->setOptions($config['http_client_options']);
        }
        $client = new Client($httpClient, $config['base_uri']);
        if (isset($config['default_headers'])) {
            $client->setDefaultHeaders($config['default_headers']);
        }
        if (isset($config['throw_exceptions'])) {
            $client->setThrowExceptions($config['throw_exceptions']);
        }
        return $client;
    }
1194664
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        if (!array_key_exists($requestedName, $this->dataForModuleOptionsCreate)) {
            if (!$serviceLocator instanceof ModuleOptionsPluginManagerInterface) {
                return false;
            }
            /** @var ModuleOptionsPluginManagerInterface $serviceLocator  */
            $this->buildDataForModuleOptionsCreate($serviceLocator, $requestedName);
        }

        return false !== $this->dataForModuleOptionsCreate[$requestedName];
    }
57270
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $config = $this->configs[$requestedName];
        if (!$config['type']) {
            throw new \RuntimeException('Unknown "type" config.');
        }
        if (!$config['options']) {
            throw new \RuntimeException('Unknown "options" config.');
        }

        $className = __NAMESPACE__ . '\\Adapter\\' . ucfirst($config['type']);
        if (!class_exists($className)
            || !in_array(__NAMESPACE__ . '\\Adapter\\StorageInterface', class_implements($className))
        ) {
            throw new \RuntimeException('Error config type:' . $config['type']);
        }

        /** @var Adapter\AbstractStorageAdapter $fileStorage */
        $fileStorage = new $className($config['options']);

        /**
         * @var \Zend\Validator\ValidatorPluginManager $vm
         * @var \Zend\Filter\FilterPluginManager $fm
         */
        $vm = $serviceLocator->get('ValidatorManager');
        $fm = $serviceLocator->get('FilterManager');
        $fm->setInvokableClass('lowercasename', 'Gzfextra\FileStorage\Filter\LowerCaseName');
        $fm->setInvokableClass('renameupload', 'Gzfextra\FileStorage\Filter\RenameUpload');

        $this->setFileAlias($vm, $fm);

        $fileStorage->getValidatorChain()->setPluginManager($vm);
        $fileStorage->getFilterChain()->setPluginManager($fm);

        if (isset($config['options']['validators'])) {
            $fileStorage->addValidators($config['options']['validators']);
        }

        if (isset($config['options']['filters'])) {
            $fileStorage->addFilters($config['options']['filters']);
        }
        return $fileStorage;
    }
519999
public function canCreate(ContainerInterface $serviceLocator, $requestedName)
    {
        if (substr($requestedName, -6) == self::WIDGET_SUFFIX) {
            /** @var $util \PageBuilder\Util\Widget */
            $util     = $serviceLocator->get('util\widget');
            $widgetId = str_replace(self::WIDGET_SUFFIX, '', $requestedName);

            return $util->widgetExist($widgetId);
        }

        return false;
    }
195945
public function canCreate(ContainerInterface $container, $requestedName)
    {
        $namespace = $this->getConfig($container)['namespace'];
        $ar = explode('_', $requestedName);

        return (count($ar) >= 2 && array_key_exists($ar[0], $namespace) && $ar[1] === 'model');
    }
870687
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        if (is_null($this->cachedFileGateway)) {
            $this->cachedFileGateway = new FileGateway(
                $serviceLocator->get('prooph.link.fileconnector.file_type_adapter_manager'),
                $serviceLocator->get('prooph.link.fileconnector.filename_renderer'),
                $serviceLocator->get('prooph.link.app.location_translator')
            );
        }

        return $this->cachedFileGateway;
    }
208920
protected function createControllerWithName(ServiceLocatorInterface $services, $requestedName)
    {
        $options = $this->getOptions($requestedName, $services);

        $controllerType = $options->getControllerType() ?: RestfulController::class;

        return new $controllerType(
            $services->get('DomainServiceManager')->get($requestedName),
            $options
        );
    }
649546
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        if (null === $this->workflowServiceNamePrefix) {
            $this->workflowServiceNamePrefix = $this->buildWorkflowServiceNamePrefix($serviceLocator);
        }

        $flag = 0 === strpos($requestedName, $this->workflowServiceNamePrefix) && strlen($requestedName) > strlen($this->workflowServiceNamePrefix);
        return $flag;
    }
15723
public static function create(ProviderRepository $providerRepository = null)
    {
        $container = new Container(
            $providerRepository
        );


        if (!$container->isProvided(AnnotationServiceProvider::class)) {
            $container->addProvider(AnnotationServiceProvider::class);
        }

        $container->add(
            Container::class,
            function () use ($container) {
                return $container;
            }
        )->alias(ContainerInterface::class);

        return $container;
    }
668158
public function add( $serviceName, $service, $expectedReturnType = null ) {

		if ( !is_callable( $service ) ) {
			$service = function() use( $service ) {
				return $service;
			};
		}

		$this->containerBuilder->registerCallback( $serviceName, $service );

		if ( $expectedReturnType !== null ) {
			$this->containerBuilder->registerExpectedReturnType( $serviceName, $expectedReturnType );
		}
	}
455393
public function canCreateServiceWithName(
        ServiceLocatorInterface $serviceLocator,
        $name,
        $requestedName
    ) {
        $config = $serviceLocator->getServiceLocator()->get('Config');

        return isset($config['rcmPlugin'][$requestedName]);
    }
1017017
public function register(ContainerInterface $container, Configurable $config)
    {
        if ( ! $config instanceof Config) {
            throw new \InvalidArgumentException('Wrong Config object');
        }

        $requestFilter = new RequestFilter($config);

        $container->add($config->getServiceName(), $requestFilter);
    }
1363536
public function createStorage($containerName)
    {
        $storageProvider = $this->createStorageProvider();

        return new Storage(
            $storageProvider->createFilesystem($containerName),
            $storageProvider->getBaseUrl($containerName)
        );
    }
416360
protected function getConfig($requestedName, ServiceLocatorInterface $services)
    {
        if ($this->configKey) {
            $config = $services->get('Config');
            if (!empty($config[$this->configKey][$requestedName])
                && is_array($config[$this->configKey][$requestedName])
            ) {
                return $config[$this->configKey][$requestedName];
            }
        }

        return [];
    }