Initializes the type extensions.

@throws UnexpectedTypeException if any registered type extension is not
an instance of FormTypeExtensionInterface
19656
private function initTypeExtensions()
    {
        $this->typeExtensions = [];

        foreach ($this->loadTypeExtensions() as $extension) {
            if (!$extension instanceof FormTypeExtensionInterface) {
                throw new UnexpectedTypeException($extension, 'Symfony\Component\Form\FormTypeExtensionInterface');
            }

            if (method_exists($extension, 'getExtendedTypes')) {
                $extendedTypes = [];

                foreach ($extension::getExtendedTypes() as $extendedType) {
                    $extendedTypes[] = $extendedType;
                }
            } else {
                @trigger_error(sprintf('Not implementing the static getExtendedTypes() method in %s when implementing the %s is deprecated since Symfony 4.2. The method will be added to the interface in 5.0.', \get_class($extension), FormTypeExtensionInterface::class), E_USER_DEPRECATED);

                $extendedTypes = [$extension->getExtendedType()];
            }

            foreach ($extendedTypes as $extendedType) {
                $this->typeExtensions[$extendedType][] = $extension;
            }
        }
    }
779746
private function initTypes(): void
    {
        $this->types = [];

        foreach ($this->loadTypes() as $type) {
            if (!$type instanceof ObjectTypeInterface) {
                throw new UnexpectedTypeException($type, 'Fxp\Component\DefaultValue\ObjectTypeInterface');
            }

            $this->types[$type->getClass()] = $type;
        }
    }
828268
public void addExtension(Object extension) {
        if (extension == null)
            return;
        if (_extensions == null)
            _extensions = new ArrayList<>();
        _extensions.add(extension);
    }
31920
private void init() {
    masterLanguage = null;
    additionalRootAttrs.clear();
    // the collection is not modifiable and therefore cannot be cleared.
    additionalNamespaces = new ArrayList<>();
    textNodeList.clear();
    parseWarnings.clear();
  }
331466
public function init()
    {
        $extensions = [];

        if (empty($this->extensionClasses) && empty($this->userConfig)) {
            return;
        }

        foreach ($this->extensionClasses as $extensionClass) {
            if (!class_exists($extensionClass)) {
                throw new \InvalidArgumentException(sprintf(
                    'Extension class "%s" does not exist',
                    $extensionClass
                ));
            }

            $extension = new $extensionClass();

            if (!$extension instanceof ExtensionInterface) {
                throw new \InvalidArgumentException(sprintf(
                    // add any manually specified extensions
                    'Extension "%s" must implement the PhpBench\\Extension interface',
                    get_class($extension)
                ));
            }

            $extensions[] = $extension;

            $this->config = array_merge(
                $this->config,
                $extension->getDefaultConfig()
            );
        }

        $diff = array_diff(array_keys($this->userConfig), array_keys($this->config));

        if ($diff) {
            throw new \InvalidArgumentException(sprintf(
                'Unknown configuration keys: "%s". Permitted keys: "%s"',
                implode('", "', $diff), implode('", "', array_keys($this->config))
            ));
        }

        $this->config = array_merge(
            $this->config,
            $this->userConfig
        );

        foreach ($extensions as $extension) {
            $extension->load($this);
        }
    }
257521
protected void initType() {
        try {
            this.type = getEnhancedAnnotated().getJavaClass();
        } catch (ClassCastException e) {
            Type type = Beans.getDeclaredBeanType(getClass());
            throw BeanLogger.LOG.producerCastError(getEnhancedAnnotated().getJavaClass(), (type == null ? " unknown " : type), e);
        }
    }
37750
private function initTypes()
    {
        $this->types = array();

        foreach ($this->loadTypes() as $type) {
            if (!$type instanceof TableTypeInterface) {
                throw new UnexpectedTypeException($type, 'Swoopaholic\Component\Table\TableTypeInterface');
            }

            $this->types[$type->getName()] = $type;
        }
    }
701946
public function initRuntime()
    {
        $this->runtimeInitialized = true;

        foreach ($this->getExtensions() as $extension) {
            $extension->initRuntime($this);
        }
    }
161240
private function initFilterTypeExtensions()
    {
        $this->filterTypeExtensions = [];

        foreach ($this->loadFilterTypeExtensions() as $extension) {
            if (!$extension instanceof FilterTypeExtensionInterface) {
                throw new UnexpectedTypeException($extension, FilterTypeExtensionInterface::class);
            }

            $type = $extension->getExtendedType();

            $this->filterTypeExtensions[$type][] = $extension;
        }
    }
1052683
private function registerTwigExtensions()
    {
        foreach ($this->app->getSetting('twig_extensions', []) as $extension) {
            $this->twig->addExtension(new $extension($this));
        }
    }
386380
private void init(IESigType eSigType) {
        List<ESigItem> list = new ArrayList<>();
        eSigType.loadESigItems(list);
        eSigList.addAll(list);
    }
1085827
private function initFilterTypes()
    {
        $this->filterTypes = [];

        foreach ($this->loadFilterTypes() as $type) {
            if (!$type instanceof FilterTypeInterface) {
                throw new UnexpectedTypeException($type, FilterTypeInterface::class);
            }

            $this->filterTypes[get_class($type)] = $type;
        }
    }
159378
private function initTypeExtensions()
    {
        $this->typeExtensions = [];

        foreach ($this->loadTypeExtensions() as $extension) {
            if (!$extension instanceof BlockTypeExtensionInterface) {
                throw new Exception\UnexpectedTypeException(
                    $extension,
                    'Oro\Component\Layout\BlockTypeExtensionInterface'
                );
            }

            $type = $extension->getExtendedType();

            $this->typeExtensions[$type][] = $extension;
        }
    }
579287
protected function initExtensionType()
    {
        // We have to get the class of our injector
        $class = '';
        if (!class_exists($class = $this->extensionType) &&
            !class_exists($class = strstr($this->extensionType, '(', true))) {
            throw new \Exception('Unknown injector class ' . $class);
        }

        // We also have to get the parameter
        $parameters = array();
        preg_match('`\((.+)\)`', $this->getExtensionType(), $parameters);

        // Clean them up and separate them
        $parameterString = str_replace(array(' ', '\''), array(''), $parameters[1]);
        $clearParameters = explode(',', $parameterString);

        // Instantiate the injector and  init it
        $this->injector = new $class($clearParameters[0], $clearParameters[1], $clearParameters[2]);
        $this->injector->init();
    }
524046
private static void initPrefixHandlers()
    {
        PrefixHandlerConfig[] prefixHandlers = ConfigUtil.getConfig().getPrefixHandlers();
        if ( prefixHandlers == null )
        {
            return;
        }
        for ( int i = 0; i < prefixHandlers.length; i++ )
        {
            try
            {
                Class prefixClass = Class.forName( prefixHandlers[i].getHandlerClass() );
                String name = prefixHandlers[i].getName();
                if ( name == null || name.equals( "" ) )
                {
                    _log.warn( "The name for the prefix handler '" + prefixHandlers[i].getHandlerClass()
                            + "' must not be null" );
                    continue;
                }
                Object o = prefixClass.newInstance();
                if ( !( o instanceof RequestParameterHandler ) )
                {
                    _log.warn( "The class '" + prefixHandlers[i].getHandlerClass()
                            + "' must be an instance of RequestParameterHandler" );
                    continue;
                }
                ProcessPopulate.registerPrefixHandler( name, ( RequestParameterHandler ) o );
            }
            catch ( ClassNotFoundException e )
            {
                _log.warn( "Class '" + prefixHandlers[i].getHandlerClass() + "' not found", e );
            }
            catch ( IllegalAccessException e )
            {
                _log.warn( "Illegal access on Class '" + prefixHandlers[i].getHandlerClass() + "'", e );

            }
            catch ( InstantiationException e )
            {
                _log.warn( "InstantiationException on Class '" + prefixHandlers[i].getHandlerClass() + "'",
                        e.getCause() );
            }
        }
    }
96565
private function initColumnTypeExtensions()
    {
        $this->columnTypeExtensions = [];

        foreach ($this->loadColumnTypeExtensions() as $extension) {
            if (!$extension instanceof ColumnTypeExtensionInterface) {
                throw new UnexpectedTypeException($extension, ColumnTypeExtensionInterface::class);
            }

            $type = $extension->getExtendedType();

            $this->columnTypeExtensions[$type][] = $extension;
        }
    }
966447
private function initializeTypes()
    {
        foreach ($this->typesConfig as $typeName => $typeConfig) {
            if (Type::hasType($typeName)) {
                Type::overrideType($typeName, $typeConfig['class']);
            } else {
                Type::addType($typeName, $typeConfig['class']);
            }
        }

        $this->initialized = true;
    }