verify if class name is an existing operator
@param ServiceLocatorInterface $serviceLocator
@param type $name
@param type $requestedName
@return boolean
484742
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) {
        $interface = 'oat\search\base\command\OperatorConverterInterface';
        return (class_exists($requestedName) && in_array($interface , class_implements($requestedName)));
    }
248256
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $config = $this->getConfig($serviceLocator)[$requestedName];

        $defaultSender = isset($config['default_sender']) ? $config['default_sender'] : null;
        $aliasSender = isset($config['alias_sender']) ? $config['alias_sender'] : null;
        $transport = Factory::create($config['transport']);

        $serviceClient = new MailService($transport, $defaultSender);
        $serviceClient->setAdditionalInfo(isset($config['additional_info']) ? $config['additional_info'] : []);

        return $serviceClient;
    }
255167
public function hasService($name)
    {
        if (!$this->serviceManager) {
            return false;
        }

        return $this->serviceManager->has($name, false);
    }
851648
public static function factory(ContainerInterface $container, $requestedName, array $options=[])
    {
        $ob = new self($options);
        $ob->setContainer($container);
        return $ob;
    }
743218
private function isRequiredFilterValid(string $name, Request $request): bool
    {
        $matches = [];
        parse_str($name, $matches);
        if (!$matches) {
            return false;
        }

        $rootName = (string) (array_keys($matches)[0] ?? null);
        if (!$rootName) {
            return false;
        }

        if (\is_array($matches[$rootName])) {
            $keyName = array_keys($matches[$rootName])[0];

            $queryParameter = $request->query->get($rootName);

            return \is_array($queryParameter) && isset($queryParameter[$keyName]);
        }

        return null !== $request->query->get($rootName);
    }
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');
    }
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];
    }
685407
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $config = $this->getConfig($serviceLocator)[$requestedName];
        /** @var $mongodb \MongoDb */
        $mongodb = $serviceLocator->get($config['database']);
        return $mongodb->selectCollection($config['collection']);
    }
31795
public function isRegistered($name)
    {
        return
            array_key_exists($name, $this->services)
            || (
                isset($this->serviceProviders[$name])
                && $this->serviceProviders[$name] instanceof ServiceProviderInterface
            );
    }
557109
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        if (array_key_exists($requestedName, $this->prototype)) {
            return false !== $this->prototype[$requestedName];
        }

        $appServiceLocator = $serviceLocator;
        if ($serviceLocator instanceof AbstractPluginManager) {
            $appServiceLocator = $serviceLocator->getServiceLocator();
        }

        /** @var OrmEntityLocatorInterface $ormEntityLocator */
        $ormEntityLocator = $appServiceLocator->get(OrmEntityLocatorInterface::class);

        $hasOrmEntity = $ormEntityLocator->has($requestedName);
        if (false === $hasOrmEntity) {
            $this->prototype[$requestedName] = false;
        }

        return $hasOrmEntity;
    }
1146010
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $config = $serviceLocator->get('Config');
        if (!isset($config) || !isset($config[$this->configKey])) {
            return false;
        }
        return (isset($config[$this->configKey][$requestedName]) && is_array($config[$this->configKey][$requestedName]));
    }
98449
protected function getInputFilterByName(ServiceLocatorInterface $serviceLocator, $name)
    {
        if ($serviceLocator->has('InputFilterManager')) {
            $serviceLocator = $serviceLocator->get('InputFilterManager');
        }

        $obj = $serviceLocator->get($name);
        if (!$obj instanceof InputFilterInterface) {
            throw new Exception\RuntimeException(sprintf(
                'Instance of type %s is invalid; must implement %s',
                (is_object($obj) ? get_class($obj) : gettype($obj)),
                InputFilterInterface::class
            ));
        }
        return $obj;
    }
338502
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $factory = new NavigationFactory($requestedName);
        return $factory->createService($serviceLocator);
    }
689236
protected function mergeMvcConfig(ServiceLocatorInterface $serviceLocator, string $requestedName = null)
    {
        $config = $serviceLocator->has('config') ? $serviceLocator->get('config') : [];

        if (! isset($config['bsb_flysystem']['adapters'][$requestedName]['options']) ||
            ! is_array(($config['bsb_flysystem']['adapters'][$requestedName]['options']))
        ) {
            return;
        }

        $this->options = ArrayUtils::merge(
            $config['bsb_flysystem']['adapters'][$requestedName]['options'],
            $this->options
        );
    }
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;
    }
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;
    }
213691
public function createDelegatorWithName(
        ServiceLocatorInterface $serviceLocator,
        $name,
        $requestedName,
        $callback
    ) {
        $viewHelper = $callback();

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

        return $viewHelper;
    }