@param ContainerInterface $serviceLocator
@param string $requestedName

@return bool
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;
    }
1047756
public function hasService(string $serviceKey): bool
    {
        try {
            $this->getService($serviceKey);
        } catch (MissingServiceException $e) {
            return false;
        }
        return true;
    }
851648
public static function factory(ContainerInterface $container, $requestedName, array $options=[])
    {
        $ob = new self($options);
        $ob->setContainer($container);
        return $ob;
    }
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;
    }
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)
        );
    }
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;
    }
294050
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        if (strpos($requestedName, 'sqlconnector:::') === 0) {
            /** @var $config ProcessingConfig */
            $config = $serviceLocator->get("processing_config");

            return isset($config->getConnectors()[$requestedName]);
        }

        return false;
    }
1030399
public function getServiceClass(string $serviceName, bool $forced = true): ?string {
        if(!isset($this->serviceClassNames[$serviceName])) {
            if($this->serviceExists($serviceName)) {
                /** @var ContainerInterface $container */
                $container = $this->serviceData[$serviceName];
                if($container->isInstanceLoaded()) {
                    $this->serviceClassNames[$serviceName] = get_class( $container->getInstance() );
                    goto finish;
                }

                if($container instanceof ServiceAwareContainerInterface) {
                    $this->serviceClassNames[$serviceName] = $container->getServiceClass();
                    goto finish;
                } elseif($container instanceof ConfiguredServiceContainer) {
                    $cfg = $container->getConfiguration();
                    // In case of a direct instance fonciguration, get this classname
                    if($cn = $cfg[AbstractFileConfiguration::SERVICE_CLASS] ?? NULL) {
                        $this->serviceClassNames[$serviceName] = $cn;
                        goto finish;

                    } elseif($cn = $cfg[AbstractFileConfiguration::CONFIG_SERVICE_TYPE_KEY] ?? NULL) {
                        // If the developer defined the class by configuration in case of container or file initialisation, use this.
                        $this->serviceClassNames[$serviceName] = $cn;
                        goto finish;
                    }
                }

                // If nothing worked before, finally load the instance
                if($forced)
                    $this->serviceClassNames[$serviceName] = get_class( $container->getInstance() );
            } else {
                // Mark as not existing
                $this->serviceClassNames[$serviceName] = false;
            }
        }

        finish:

        return $this->serviceClassNames[$serviceName] ?: NULL;
    }
213691
public function createDelegatorWithName(
        ServiceLocatorInterface $serviceLocator,
        $name,
        $requestedName,
        $callback
    ) {
        $viewHelper = $callback();

        if ($viewHelper instanceof FormStatic) {
            $viewHelper->addClass(ImageInterface::class, 'cmsImage');
        }

        return $viewHelper;
    }
552395
public function canCreate(ContainerInterface $container, $requestedName)
    {
        $config = $this->getConfig($container);

        return isset($config[$requestedName]);
    }
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));
    }
252034
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        try {
            $className = $this->getFormaterIndex($serviceLocator)[$this->removeTermination($requestedName)];
            $reflectionClass = new \ReflectionClass($className);
            $instance = $reflectionClass->newInstance();
        } catch (\Exception $e) {
            throw new ProcessException($reflectionClass, $e->getCode(), $e);
        }
        
        return $instance;
    }
98111
public function canCreate(ContainerInterface $container, $requestedName)
    {
        /** @var BlockPluginManager $blockPluginManager */
        $blockPluginManager = $container->get(BlockPluginManager::class);
        $blocks = $blockPluginManager->getAvailableBlocks();

        return in_array($requestedName, $blocks);
    }
80949
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $this->init($serviceLocator);
        return $this->getDoctrineObjectHydratorLocator()->has($requestedName);
    }
1134730
public function buildService(Container $container, ArrayResolver $serviceConfig, $serviceName)
    {
        return $this->serviceBuilder->buildService($container, $serviceConfig, $serviceName);
    }
17763
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $config = $this->getConfig($serviceLocator);
        $config = $config[$requestedName];

        if (!isset($config['collectorFactory'])) {
            throw new MissingConfigurationException('Unable to create DataTable service: collectorFactory is missing');
        }

        if (!isset($config['columns']) || empty($config['columns'])) {
            throw new MissingConfigurationException('Unable to create DataTable service: columns are missing');
        }

        /** @var FactoryInterface $collectorFactory */
        $collectorFactory = new $config['collectorFactory'];

        $datatable = new DataTable(isset($config['id']) ? $config['id'] : $requestedName);
        $datatable->setCollector($collectorFactory->createService($serviceLocator));
        $columns = array();
        foreach ($config['columns'] as $columnConfig) {
            $columns[] = Column::factory($serviceLocator, $columnConfig);
        }
        $datatable->setColumns($columns);
        if (isset($config['classes'])) {
            $datatable->setClasses($config['classes']);
        }

        return $datatable;
    }
743645
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $config = $this->getConfig($serviceLocator);
        $config = $config[$requestedName];

        $factory = isset($config['factory']) ? new $config['factory'] : new RepositoryFactory();
        $factory->setConfig($config);

        return $factory->createService($serviceLocator);
    }