@return mixed|HCConfigService

@throws HCException
@throws \Illuminate\Contracts\Container\BindingResolutionException
332471
private function getConfigService()
    {
        $className = config('hc.config_service');
        $service = app()->make($className);

        if (!$service instanceof HCConfigServiceContract) {
            throw new HCException(
                'Class ' . $className . ' must be instance of HoneyComb\\Core\\Contracts\\HCConfigServiceContract'
            );
        }

        return $service;
    }
818050
public function detectConfig(): ConfigurationInterface
    {
        if (file_exists($file = $this->rootDir.'/config/sculpin_site_'.$this->environment.'.yml')) {
            return $this->getConfigFile($file);
        }

        if (file_exists($file = $this->rootDir.'/config/sculpin_site.yml')) {
            return $this->getConfigFile($file);
        }

        return new Configuration();
    }
947250
private function getOptionsResolver()
    {
        // TODO Use/Merge ConfigurationBuilder options resolver.
        if (!$this->optionsResolver) {
            $resolver = new OptionsResolver();

            $resolver
                ->setRequired(['namespace', 'id', 'classes'])
                ->setDefaults([
                    'name'        => function (Options $options) {
                        return Inflector::camelize($options['id']);
                    },
                    'parent_id'   => null,
                    'event'       => null,
                    'templates'   => null,
                    'translation' => null,
                ])
                ->setAllowedTypes('namespace', 'string')
                ->setAllowedTypes('id', 'string')
                ->setAllowedTypes('name', 'string')
                ->setAllowedTypes('parent_id', ['null', 'string'])
                ->setAllowedTypes('classes', 'array')
                ->setAllowedTypes('event', ['null', 'string', 'array'])
                ->setAllowedTypes('templates', ['null', 'string', 'array'])
                ->setAllowedTypes('translation', ['null', 'array']);


            // Classes option
            $classesResolver = new OptionsResolver();
            $classesResolver
                ->setRequired(['entity'])
                ->setDefaults([
                    'form_type'  => null, // @TODO/WARNING no longer required (behavior refactoring)
                    'repository' => null,
                ])
                ->setAllowedTypes('entity', 'string')
                ->setAllowedTypes('repository', ['null', 'string'])
                ->setAllowedTypes('form_type', ['null', 'string']); // @TODO/WARNING no longer required (behavior refactoring)

            $resolver
                ->setNormalizer('classes', function (Options $options, $value) use ($classesResolver) {
                    foreach ($value as $class) {
                        if ($class && !class_exists($class)) {
                            throw new InvalidOptionsException(sprintf("Class '%s' does not exists.", $class));
                        }
                    }

                    $entity = $value['entity'];
                    if (null !== $options['translation'] && !is_subclass_of($entity, TranslatableInterface::class)) {
                        throw new InvalidOptionsException(sprintf(
                            "Class '%s' must implements '%s'.",
                            $entity,
                            TranslatableInterface::class));
                    }

                    $repository = array_key_exists('repository', $value) ? $value['repository'] : null;
                    if (null === $repository) {
                        $value['repository'] = null !== $options['translation']
                            ? TranslatableResourceRepository::class
                            : ResourceRepository::class;
                    } elseif (null !== $options['translation']) {
                        if (!is_subclass_of($repository, TranslatableResourceRepositoryInterface::class)) {
                            throw new InvalidOptionsException(sprintf(
                                "Class '%s' must implements '%s'.",
                                $repository,
                                TranslatableResourceRepositoryInterface::class
                            ));
                        }
                    } else {
                        if (!is_subclass_of($repository, ResourceRepositoryInterface::class)) {
                            throw new InvalidOptionsException(sprintf(
                                "Class '%s' must implements '%s'.",
                                $repository,
                                ResourceRepositoryInterface::class
                            ));
                        }
                    }

                    return $classesResolver->resolve($value);
                });


            // Translation option
            $translationResolver = new OptionsResolver();
            $translationResolver
                ->setRequired(['entity', 'fields'])
                ->setDefault('repository', null)
                ->setAllowedTypes('entity', 'string')
                ->setAllowedTypes('fields', 'array')
                ->setAllowedTypes('repository', ['null', 'string'])
                ->setAllowedValues('entity', function ($class) {
                    if (!class_exists($class)) {
                        throw new InvalidOptionsException(sprintf("Class '%s' does not exists.", $class));
                    }
                    if (!is_subclass_of($class, TranslationInterface::class)) {
                        throw new InvalidOptionsException(sprintf("Class '%s' must implements '%s'.", $class, TranslationInterface::class));
                    }

                    return true;
                })
                ->setAllowedValues('fields', function ($fields) {
                    if (empty($fields)) {
                        throw new InvalidOptionsException("Translatable fields cannot be empty.");
                    }

                    return true;
                })
                ->setAllowedValues('repository', function ($class) {
                    if (null !== $class && !class_exists($class)) {
                        throw new InvalidOptionsException(sprintf("Class '%s' does not exists.", $class));
                    }

                    return true;
                });

            /** @noinspection PhpUnusedParameterInspection */
            $resolver->setNormalizer('translation', function (Options $options, $value) use ($translationResolver) {
                if (is_array($value)) {
                    return $translationResolver->resolve($value);
                }

                return $value;
            });


            // Event option
            $eventResolver = new OptionsResolver();
            $eventResolver
                ->setRequired(['class'])
                ->setDefaults([
                    'class'    => $this->defaultEventClass,
                    'priority' => 0,
                ])
                ->setAllowedTypes('class', 'string')
                ->setAllowedTypes('priority', 'int');

            /** @noinspection PhpUnusedParameterInspection */
            $resolver->setNormalizer('event', function (Options $options, $value) use ($eventResolver) {
                if (is_string($value)) {
                    $value = ['class' => $value];
                }

                $value = $eventResolver->resolve((array)$value);

                if (!is_subclass_of($value['class'], ResourceEventInterface::class)) {
                    throw new InvalidOptionsException(sprintf(
                        "Class '%s' must implements '%s'.",
                        $value['class'],
                        ResourceEventInterface::class
                    ));
                }

                return $value;
            });


            // Templates option
            /** @noinspection PhpUnusedParameterInspection */
            $resolver->setNormalizer('templates', function (Options $options, $value) {
                return $this->buildTemplateList($value);
            });


            $this->optionsResolver = $resolver;
        }

        return $this->optionsResolver;
    }
1171063
private function rebindModels()
    {
        $config   = $this->config();
        $bindings = [
            [
                'abstract' => \Arcanesoft\Contracts\Auth\Models\User::class,
                'concrete' => $config->get('arcanesoft.auth.users.model'),
            ],[
                'abstract' => \Arcanesoft\Contracts\Auth\Models\Role::class,
                'concrete' => $config->get('arcanesoft.auth.roles.model'),
            ],[
                'abstract' => \Arcanesoft\Contracts\Auth\Models\Permission::class,
                'concrete' => $config->get('arcanesoft.auth.permissions.model'),
            ],[
                'abstract' => \Arcanesoft\Contracts\Auth\Models\PermissionsGroup::class,
                'concrete' => $config->get('arcanesoft.auth.permissions-groups.model'),
            ],
        ];

        foreach ($bindings as $binding) {
            $this->bind($binding['abstract'], $binding['concrete']);
        }
    }
245258
private function getResolverHandlerChain()
    {
        $randomResolver = $this->resolverFactory->create(Random::class);
        $nonMutualResolver = $this->resolverFactory->create(NonMutual::class, $randomResolver);

        return $this->resolverFactory->create(FromExistingPair::class, $nonMutualResolver);
    }
46572
public function getConfiguration(){
        $rest = $this->getService( self::API_PARENTAL_CONFIG);
        $rest->GET();

        return $rest->getResult( models\ParentalControl\FilterConfig::class);
    }
451643
protected function compileImplementationBinding(Binding $binding)
	{
		$code = "return \$this->createObject(";
		$code .= var_export($binding->getTarget(), true) . ', [';
		$rpos = 0;
		
		foreach((array)$binding->getResolvers() as $para => $resolver)
		{
			if($rpos++ > 0)
			{
				$code .= ', ';
			}
				
			if($resolver instanceof \Closure)
			{
				$num = count($this->methods);
		
				$ref = new \ReflectionFunction($resolver);
				$sig = $this->generateReplacementMethodSignature($ref, $num);
				$body = $this->extractClosureCode($ref);
		
				$this->methods[] = "\t\t" . $sig . " {\n" . $body . "\n\t\t}";
		
				$call = $this->generateCallCode($binding->getTypeName(), $ref, $num);
		
				$code .= var_export($para, true) . ' => function(InjectionPointInterface $point = NULL) { return ' . $call . '; }';
			}
			else
			{
				$code .= var_export($para, true) . ' => ' . var_export($resolver, true);
			}
		}
		
		$code .= "], [";
		$rpos = 0;
		
		foreach((array)$binding->getInitializers() as $initializer)
		{
			if($rpos++ > 0)
			{
				$code .= ', ';
			}
				
			$num = count($this->methods);
				
			$ref = new \ReflectionFunction($initializer);
			$sig = $this->generateReplacementMethodSignature($ref, $num);
			$body = $this->extractClosureCode($ref);
				
			$code .= '[$this, ' . var_export('call_' . $num, true) . ']';
				
			$this->methods[] = "\t\t" . $sig . " {\n" . $body . "\n\t\t}";
		}
		
		$code .= "], " . $this->compileSetterInjector($binding) . ");\n";
		$code .= ";\n";
		
		return $code;
	}
575715
public function get($key, array $parameters = [])
    {
        // If service is a factory, we should always
        // return new instance of the service.
        if (isset($this->factories[$key])) {
            return $this->resolve($this->factories[$key], $parameters);
        }

        // Otherwise, look for service
        // in services collection.
        if (isset($this->services[$key])) {
            // Resolve service jf we don't have
            // a deposit for this service.
            if ( ! isset($this->deposit[$key])) {
                $this->deposit[$key] = $this->resolve($this->services[$key], $parameters);
            }

            return $this->deposit[$key];
        }

        throw new BindingResolutionException("Unresolvable resolution. The [{$key}] binding is not registered.");
    }
1237431
public function getConfiguration(){
        $rest = $this->getService( self::API_SYSTEM);
        $rest->GET();

        return $rest->getResult( models\SystemConfig::class);
    }
419334
protected function getConfigurationBuilder()
    {
        return Builder::create()
            ->enableTags()
            ->enableCategories()
            ->enableLimit()
            ->enablePagination()
            ->enablePresentAs()
            ->setDeepLink('articles/{locale}/edit:{id}/details')
            ->enableSorting(
                [
                    ['column' => 'published', 'title' => 'sulu_article.smart-content.published'],
                    ['column' => 'authored', 'title' => 'sulu_article.smart-content.authored'],
                    ['column' => 'created', 'title' => 'sulu_article.smart-content.created'],
                    ['column' => 'title', 'title' => 'sulu_article.smart-content.title'],
                    ['column' => 'author_full_name', 'title' => 'sulu_article.smart-content.author-full-name'],
                ]
            );
    }
494571
static public function resolveConfiguration() {
		static::$init=true;
		$self = new static();
		static::$init=false;
		$conf = array (
			'table'=>$self->getTable(),
			'fieldConf'=>$self->getFieldConfiguration(),
			'db'=>$self->db,
			'fluid'=>$self->fluid,
			'primary'=>$self->primary,
			'charset'=>$self->charset,
		);
		unset($self);
		return $conf;
	}
1162080
public function resolve()
    {
        foreach ($this->sidebars as $name) {
            $sidebar = $this->resolver->resolve($name);

            $this->container->singleton($name, function () use ($sidebar) {
                return $sidebar;
            });
        }
    }
117034
protected function _getConf()
    {
        // retrieve and cache config
        $services = $this->services();

        /** @var aSapi $config */
        $config   = $services->get('/sapi');
        $orig = $config   = $config->config();
        /** @var DataEntity $config */
        $config   = $config->get(\Module\Authorization\Module::CONF, array());

        if (!isset($config[self::CONF]) && !is_array($config[self::CONF]))
            return null;


        $config   = $config[self::CONF];
        return $config;
    }
907967
protected function getBindings() {
        if (!$this->_bindings) {
            $this->_bindings = new BindingList($this->version, $this->solution['sid']);
        }

        return $this->_bindings;
    }
1052771
public function getConfigurationService()
    {
        if ($this->configurationService == null) {
            $this->configurationService = $this->newService('AppserverIo\Appserver\Core\Api\ConfigurationService');
        }
        return $this->configurationService;
    }
1339578
public function getConfig()
    {
        if ($this->config) {
            return $this->config;
        }

        $config = $this->getDefaultConfig();

        // read from database
        $result = $this->connection->fetchAll('SELECT type, class FROM fusio_provider ORDER BY class ASC');
        foreach ($result as $row) {
            $this->mergeClass($config, $row['type'], $row['class']);
        }

        // read from file
        if (!empty($this->file)) {
            $result = include($this->file);

            if (is_array($result)) {
                foreach ($result as $type => $classes) {
                    foreach ($classes as $class) {
                        $this->mergeClass($config, $type, $class);
                    }
                }
            }
        }

        return $this->config = new ProviderConfig($config);
    }
788741
public function getResolverHandler(): ResolverHandler
    {
        if (is_null(self::$globalResolverHandler)) {
            //this should be the only place where
            //a hard coded dependancy exists
            self::$globalResolverHandler = new ResolverHandler();
        }

        if (is_null($this->resolverHandler)) {
            $this->resolverHandler = self::$globalResolverHandler;
        }

        return $this->resolverHandler;
    }