Can the factory create an instance for the service?

@param  ContainerInterface $container
@param  string $requestedName
@return bool
427125
public function canCreate(ContainerInterface $container, $requestedName)
    {
        try {
            $config = $container->get("config");
        } catch (NotFoundExceptionInterface $e) {
            return false;
        } catch (ContainerExceptionInterface $e) {
            return false;
        }

        return (isset($config[static::KEY][$requestedName]));
    }
880607
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        if ($serviceLocator instanceof AbstractPluginManager) {
            $serviceLocator = $serviceLocator->getServiceLocator();
        }

        $config = $this->getConfig($serviceLocator)[$requestedName];
        $imgManService = $serviceLocator->get($config['service']);

        if (!$imgManService instanceof ImageService) {
            throw new ServiceNotCreatedException(
                sprintf(
                    'service must be a instance of ImgMan\Service\ImageService given: %s',
                    is_object($imgManService) ? get_class($imgManService) : gettype($imgManService)
                )
            );
        }

        $resourceClass = $this->getResourceClassFromConfig($config, $requestedName);

        /* @var $resource \ImgMan\Apigility\Model\ImgManConnectedResource */
        $resource = new $resourceClass($imgManService);

        if (isset($config['idName'])) {
            $resource->setIdName($config['idName']);
        }

        if (isset($config['blobName'])) {
            $resource->setBlobName($config['blobName']);
        }

        return $resource;
    }
469457
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        return substr($requestedName, - strlen(self::$termination)) === self::$termination && array_key_exists($this->removeTermination($requestedName), $this->getFormaterIndex($serviceLocator));
    }
1123191
public function canCreate(ContainerInterface $container, $requestedName)
    {
        $config = $container->get("config");
        return (
            isset($config[static::KEY][$requestedName][static::KEY_CLASS]) &&
            is_a($config[static::KEY][$requestedName][static::KEY_CLASS], static::KEY_DEFAULT_CLASS, true)
        );
    }
208276
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        if ($serviceLocator instanceof AbstractPluginManager && $serviceLocator->getServiceLocator()) {
            $serviceLocator = $serviceLocator->getServiceLocator();
        }

        $config = $this->getConfig($serviceLocator)[$requestedName];

        //Create an object instance
        $class = $config['type'];
        if (!class_exists($class)) {
            throw new Exception\RuntimeException(sprintf(
                'ObjectAbstractServiceFactory expects the "type" to be a valid class; received "%s"',
                $class
            ));
        }
        $object = new $class;

        //Setup Hydrator
        $hydrator = null;
        if ($object instanceof HydratorAwareInterface
            && isset($config['hydrator'])
            && is_string($config['hydrator'])
            && !empty($config['hydrator'])
        ) {
            $object->setHydrator($this->getHydratorByName($serviceLocator, $config['hydrator']));
        }

        //Setup InputFilter
        if ($object instanceof InputFilterAwareInterface
            && isset($config['input_filter'])
            && is_string($config['input_filter'])
            && !empty($config['input_filter'])
        ) {
            $object->setInputFilter($this->getInputFilterByName($serviceLocator, $config['input_filter']));
        }

        //Setup ActiveRecord
        if ($object instanceof AbstractActiveRecord
            && isset($config['active_record_criteria'])
            && is_string($config['active_record_criteria'])
            && !empty($config['active_record_criteria'])
        ) {
            $object->setActiveRecordCriteriaPrototype($this->getActiveRecordCriteriaByName(
                $serviceLocator,
                $config['active_record_criteria']
            ));
        }

        return $object;
    }
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');
    }
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;
    }
1051802
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $config = $this->getConfig($serviceLocator)[$requestedName];
        return new ArrayAdapter($config);
    }
136631
private static function matchableRequest(ContainerInterface $container): MatchableRequestInterface
    {
        if (!$container->has(MatchableRequestInterface::class)) {
            return new MatchableRequest($container->get(ServerRequestInterface::class));
        }

        return $container->get(MatchableRequestInterface::class);
    }
851648
public static function factory(ContainerInterface $container, $requestedName, array $options=[])
    {
        $ob = new self($options);
        $ob->setContainer($container);
        return $ob;
    }
102783
public function createService(ServiceLocatorInterface $container)
    {
        // Retrieve the parent container when under zend-servicemanager v2
        if (method_exists($container, 'getServiceLocator')) {
            $container = $container->getServiceLocator() ?: $container;
        }

        return $this($container, DoctrineWriter::class);
    }
443836
public function buildService(Container $container, ArrayResolver $serviceConfig, $serviceName) {
        $object = $this->activate($container, $serviceConfig, $serviceName);

        // Singleton by default to prevent stack explosions
        if ($serviceConfig->resolve('singleton', true)) {
            // Only store if singleton'ed to spare memory
            $container->bind($serviceName, $object);
        }

        $this->inject($container, $object, $serviceConfig);

        return $object;
    }
292345
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $config = $serviceLocator->get('config');
        $class = $this->getClass($config, $requestedName);
        return $class && class_exists($class);
    }
679228
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        if (!isset($this->classes[$requestedName])) {
            $names    = explode('\\', $requestedName);
            $ctrlName = end($names) . 'Controller';

            array_splice($names, -1, 1, array('Controller', $ctrlName));

            $class    = implode('\\', $names);

            $this->classes[$requestedName] = $class;
        } else {
            $class = $this->classes[$requestedName];
        }

        return class_exists($class);
    }
1229777
private function resolveParameterWithoutConfigService(ContainerInterface $container, $requestedName)
    {
        /**
         * @param ReflectionParameter $parameter
         * @return mixed
         * @throws ServiceNotFoundException If type-hinted parameter cannot be
         *   resolved to a service in the container.
         */
        return function (ReflectionParameter $parameter) use ($container, $requestedName) {
            return $this->resolveParameter($parameter, $container, $requestedName);
        };
    }
1122970
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        if (substr($name, -5) != 'table') {
            return false;
        }

        if (empty($this->config)) {
            $config = $serviceLocator->get('config');
            $this->config = isset($config['tables']) ? $config['tables'] : [];
        }

        if (!isset($this->config[$requestedName])) {
            return false;
        }

        return true;
    }
688368
public function isServiceLoaded(string $serviceName): bool {
        if($this->serviceExists($serviceName)) {
            if(in_array($serviceName, $this->getSelfReferenceNames()))
                return true;

            /** @var ContainerInterface $container */
            $container = $this->serviceData[$serviceName];
            return $container->isInstanceLoaded();
        }
        return false;
    }