Classes/ConfigurationObjectFactory.php
protected function register($className)
    {
        if (false === isset($this->configurationObjectServiceFactory[$className])) {
            if (false === Core::get()->classExists($className)) {
                throw new ClassNotFoundException(
                    'Trying to get a non-existing configuration object: "' . $className . '".',
                    1448886437
                );
            }

            if (false === in_array(ConfigurationObjectInterface::class, class_implements($className))) {
                throw new WrongInheritanceException(
                    'The configuration object class: "' . $className . '" must implement "' . ConfigurationObjectInterface::class . '".',
                    1448886449
                );
            }

            /** @var ConfigurationObjectInterface $configurationObjectClassName */
            $configurationObjectClassName = $className;
            $serviceFactory = $configurationObjectClassName::getConfigurationObjectServices();
            if (false === $serviceFactory instanceof ServiceFactory) {
                throw new WrongServiceException(
                    'Service factory for configuration object class: "' . $className . '" must be an instance of "' . ServiceFactory::class . '".',
                    1448886479
                );
            }

            /** @var ServiceFactory $serviceFactory */
            $serviceFactory->initialize();

            $this->configurationObjectServiceFactory[$className] = $serviceFactory;
        }

        return $this->configurationObjectServiceFactory[$className];
    }
protected function register($className)
    {
        if (false === isset($this->configurationObjectServiceFactory[$className])) {
            if (false === Core::get()->classExists($className)) {
                throw new ClassNotFoundException(
                    'Trying to get a non-existing configuration object: "' . $className . '".',
                    1448886437
                );
            }

            if (false === in_array(ConfigurationObjectInterface::class, class_implements($className))) {
                throw new WrongInheritanceException(
                    'The configuration object class: "' . $className . '" must implement "' . ConfigurationObjectInterface::class . '".',
                    1448886449
                );
            }

            /** @var ConfigurationObjectInterface $configurationObjectClassName */
            $configurationObjectClassName = $className;
            $serviceFactory = $configurationObjectClassName::getConfigurationObjectServices();
            if (false === $serviceFactory instanceof ServiceFactory) {
                throw new WrongServiceException(
                    'Service factory for configuration object class: "' . $className . '" must be an instance of "' . ServiceFactory::class . '".',
                    1448886479
                );
            }

            /** @var ServiceFactory $serviceFactory */
            $serviceFactory->initialize();

            $this->configurationObjectServiceFactory[$className] = $serviceFactory;
        }

        return $this->configurationObjectServiceFactory[$className];
    }
protected function register ( $ className ) { if ( false === isset ( $ this -> configurationObjectServiceFactory [ $ className ] ) ) { if ( false === Core :: get ( ) -> classExists ( $ className ) ) { throw new ClassNotFoundException ( 'Trying to get a non-existing configuration object: "' . $ className . '".' , 1448886437 ) ; } if ( false === in_array ( ConfigurationObjectInterface :: class , class_implements ( $ className ) ) ) { throw new WrongInheritanceException ( 'The configuration object class: "' . $ className . '" must implement "' . ConfigurationObjectInterface :: class . '".' , 1448886449 ) ; } /** @var ConfigurationObjectInterface $configurationObjectClassName */ $ configurationObjectClassName = $ className ; $ serviceFactory = $ configurationObjectClassName :: getConfigurationObjectServices ( ) ; if ( false === $ serviceFactory instanceof ServiceFactory ) { throw new WrongServiceException ( 'Service factory for configuration object class: "' . $ className . '" must be an instance of "' . ServiceFactory :: class . '".' , 1448886479 ) ; } /** @var ServiceFactory $serviceFactory */ $ serviceFactory -> initialize ( ) ; $ this -> configurationObjectServiceFactory [ $ className ] = $ serviceFactory ; } return $ this -> configurationObjectServiceFactory [ $ className ] ; }
Any configuration object needs to be registered before it can be used.

@param  string $className Class name of the wanted configuration object.
@return ServiceFactory
@throws ClassNotFoundException
@throws WrongInheritanceException
@throws WrongServiceException
Any configuration object needs to be registered before it can be used .