Add a ConfigInterface object to collection

@param \Kaecyra\AppCommon\ConfigInterface $config
@return ConfigCollection
432470
public function addConfig(ConfigInterface $config) {
        // Add to config list
        $this->configs->attach($config);

        // If collection is in merge mode, add config data to common store
        $this->store->merge($config->dump());
        return $this;
    }
412401
public function addRuntimeConfig($config) {
        if ( ! $config instanceof IConfig && ! is_array($config)) {
            throw new InvalidRuntimeConfigException(s(
                'Runtime config must be either an array or an ' .
                'instance of IConfig, got "%s".',
                get_type($config)
            ));
        }

        if ($config instanceof IConfig) {
            $config = $config->toArray();
        }

        $this->runtimeConfigs[] = $config;

        return $this;
    }
1000076
protected function createObjectType($config)
    {
        $keyType = $this->typeFactory->toType($config);

        $keyType->provideKeysBy(function () use ($keyType) {

            $cls = $keyType->class;
            $instance = new $cls();
            $config = $this->buildConfig($instance, $cls);

            return $this->typeFactory->toType($config);
        });

        return $keyType;
    }
1325038
public function put(array $config)
    {
        foreach ($config as $key => $value) {
            $this->set($key, $value);
        }

        return $this;
    }
104962
static public function createObject($type, array $config = [])
	{
		if (is_string($type)) {
			return static::container()->get($type, $config);
		} elseif (is_array($type) && isset($type['class'])) {
			$class = $type['class'];
			unset($type['class']);
			if ($config) $type = array_merge($type, $config); 
			return static::container()->get($class, $type);
		} elseif (is_callable($type, false)) {
			return call_user_func($type, $config);
		} elseif (is_object($type)) {
			return $type;
		} elseif (is_array($type)) {
			throw new InvalidConfigException('object configuration must be an array containing a "class" element.');
		} else {
			throw new InvalidConfigException("Unsupported configuration type: " . gettype($type));
		}
	}
706026
protected function addFromConfig(array $config)
	{
		$bbcodeName = $config['bbcodeName'];
		$bbcode     = $config['bbcode'];
		$tag        = $config['tag'];

		// If the BBCode doesn't specify a tag name, it's the same as the BBCode
		if (!isset($bbcode->tagName))
		{
			$bbcode->tagName = $bbcodeName;
		}

		// Normalize this tag's templates
		$this->configurator->templateNormalizer->normalizeTag($tag);

		// Test whether this BBCode/tag is safe before adding it
		$this->configurator->templateChecker->checkTag($tag);

		// Add our BBCode then its tag
		$this->collection->add($bbcodeName, $bbcode);
		$this->configurator->tags->add($bbcode->tagName, $tag);

		return $bbcode;
	}
952735
public function getConfiguration(array $config, ContainerBuilder $container)
    {
        $configuration = $this->getConfigurationInstance();
        if ($configuration) {
            $container->addObjectResource($configuration);
        }

        return $configuration;
    }
122062
public function setConfig($config) {
        $this->config = self::configArrayMergeRecursive($this->config, $config);
        $this->invalidateResponse();
        return $this->config;
    }
1117126
protected function getConfig($config = []): ConfigInterface
    {
        $defaults = ConfigFactory::create(dirname(__DIR__, 2) . '/config/defaults.php', $config);
        $config   = $config
            ? ConfigFactory::createFromArray(array_merge_recursive($defaults->getArrayCopy(), $config->getArrayCopy()))
            : $defaults;

        return $config->getSubConfig('BrightNucleus\View');
    }
533302
public function setContextConfig(array $config)
    {
        if ($this->type == InternalBaseBlock::INJECTOR_VAR) {
            return $this->context->addVar($config, $this->append);
        }
         
        if ($this->type == InternalBaseBlock::INJECTOR_CFG) {
            return $this->context->addCfg($config, $this->append);
        }
        
        throw new InvalidConfigException("The type '{$this->type}' is not supported.");
    }
233617
public function setConfigs($config)
    {
        if (is_array($config) === false && $config instanceof \Traversable === false) {
            throw new \InvalidArgumentException(
                'Expected an array or Traversable; received: ' .
                (is_object($config) === true ? get_class($config) : gettype($config))
            );
        }
        foreach ($config as $name => $value) {
            $this->setConfig($name, $value);
        }
        return $this;
    }
196959
private function sortingPrefixer(ConfigInterface $config)
    {
        $sorting = [];
        foreach ($config->getSorting() as $property => $value) {
            if (0 === \strpos($property, $this->source . '.')) {
                $sorting[$property] = $value;

                continue;
            }

            if (!$this->fieldExists($property)) {
                continue;
            }

            $sorting[$this->source . '.' . $property] = $value;
        }
        $config->setSorting($sorting);
    }
718303
final protected function mergeConfigInstance(
        ConfigInterface $config,
        ConfigInterface $instance = null
    ) : ConfigInterface {
        $instance  = $instance?: $this;

        // if offset detect as an increment array
        $arrayInstance  =  get_object_vars($instance);
        $arrayInstance[] = true;
        end($arrayInstance);

        $increment = key($arrayInstance);
        unset($arrayInstance);
        foreach (get_object_vars($config) as $key => $value) {
            if (isset($instance->{$key})) {
                if ($value instanceof Config) {
                    if ($instance->{$key} instanceof Config) {
                        $instance->mergeConfigInstance($value, $instance->{$key});
                        continue;
                    }

                    $instance->{$key} = $value;
                    continue;
                }

                if (is_numeric($key) && is_int(abs($key))) {
                    $key = $increment;
                    $increment++;
                }
            }

            $instance->{$key} = $value;
        }

        return $instance;
    }
1050750
public function merge(Config $config)
    {
        $this->data = array_replace_recursive(
            $this->data,
            $config->toArray()
        );

        return $this;
    }
350148
public function create(ConfigInterface $config)
    {
        $operationNames = $config->get('operationNames');
        if (!empty($operationNames)) {
            return new ServiceOperationFilter($config);
        } else {
            return new DefaultFilter();
        }
    }
448417
public function register(ContainerInterface $container, Configurable $config)
    {
        if ( ! $config instanceof Config) {
            throw new \InvalidArgumentException('Wrong Config object');
        }
        
        $validator = Validation::createValidatorBuilder();

        if ($config->annotationMapping) {
            $validator->enableAnnotationMapping();
        }

        $container->add($config->getServiceName(), $validator->getValidator());
    }
908239
public function insert($config)
    {
        if (is_string($config)) {
            $config = array('name' => $config);
        }

        $config = new AnConfig($config);

        if (empty($config->link) && !empty($this->_resources)) {
            $name = AnInflector::singularize($this->main()->getName());
            $config->link = array('child' => $name.'_id','parent' => 'id');
        }

        $config->append(array(
            'columns' => $this->_store->getColumns($config->name),
        ));

        $resource = new AnDomainResource($config);
        $this->_resources[$resource->getAlias()] = $resource;

        return $this;
    }