protected function &internalGetModular(string $name) : ModularAbstract
    {
        $modularName = $this->sanitizeModularName($name);
        if (!$modularName) {
            throw new InvalidArgumentException(
                "Please insert not an empty arguments",
                E_USER_ERROR
            );
        }

        if (!$this->exist($modularName)) {
            throw new InvalidModularException(
                sprintf(
                    '%1$s %2$s has not found',
                    $this->modularParser->getName(),
                    $name
                )
            );
        }

        if (is_array($this->validModular[$modularName])) {
            $className = empty($this->validModular[$modularName][static::CLASS_NAME_KEY])
                ? null
                : (string) $this->validModular[$modularName][static::CLASS_NAME_KEY];

            if (! $className
                || ! class_exists($this->validModular[$modularName][static::CLASS_NAME_KEY])
            ) {
                throw new InvalidModularException(
                    sprintf(
                        '%1$s %2$s has not found',
                        $this->modularParser->getName(),
                        $name
                    )
                );
            }

            $modular = new $className(
                $this->modularParser->getContainer(),
                $modularName
            );

            $this->validModular[$modularName] = $modular;
        }

        if (! $this->validModular[$modularName] instanceof ModularAbstract) {
            unset($this->validModular[$modularName]);
            $e = new InvalidModularException(
                sprintf(
                    '%1$s %2$s Is not valid.',
                    $this->modularParser->getName(),
                    $name
                )
            );

            $this->invalidModular[$modularName] = $e;
            throw $e;
        }

        return $this->validModular[$modularName];
    }
protected function &internalGetModular(string $name) : ModularAbstract
    {
        $modularName = $this->sanitizeModularName($name);
        if (!$modularName) {
            throw new InvalidArgumentException(
                "Please insert not an empty arguments",
                E_USER_ERROR
            );
        }

        if (!$this->exist($modularName)) {
            throw new InvalidModularException(
                sprintf(
                    '%1$s %2$s has not found',
                    $this->modularParser->getName(),
                    $name
                )
            );
        }

        if (is_array($this->validModular[$modularName])) {
            $className = empty($this->validModular[$modularName][static::CLASS_NAME_KEY])
                ? null
                : (string) $this->validModular[$modularName][static::CLASS_NAME_KEY];

            if (! $className
                || ! class_exists($this->validModular[$modularName][static::CLASS_NAME_KEY])
            ) {
                throw new InvalidModularException(
                    sprintf(
                        '%1$s %2$s has not found',
                        $this->modularParser->getName(),
                        $name
                    )
                );
            }

            $modular = new $className(
                $this->modularParser->getContainer(),
                $modularName
            );

            $this->validModular[$modularName] = $modular;
        }

        if (! $this->validModular[$modularName] instanceof ModularAbstract) {
            unset($this->validModular[$modularName]);
            $e = new InvalidModularException(
                sprintf(
                    '%1$s %2$s Is not valid.',
                    $this->modularParser->getName(),
                    $name
                )
            );

            $this->invalidModular[$modularName] = $e;
            throw $e;
        }

        return $this->validModular[$modularName];
    }
protected function & internalGetModular ( string $ name ) : ModularAbstract { $ modularName = $ this -> sanitizeModularName ( $ name ) ; if ( ! $ modularName ) { throw new InvalidArgumentException ( "Please insert not an empty arguments" , E_USER_ERROR ) ; } if ( ! $ this -> exist ( $ modularName ) ) { throw new InvalidModularException ( sprintf ( '%1$s %2$s has not found' , $ this -> modularParser -> getName ( ) , $ name ) ) ; } if ( is_array ( $ this -> validModular [ $ modularName ] ) ) { $ className = empty ( $ this -> validModular [ $ modularName ] [ static :: CLASS_NAME_KEY ] ) ? null : ( string ) $ this -> validModular [ $ modularName ] [ static :: CLASS_NAME_KEY ] ; if ( ! $ className || ! class_exists ( $ this -> validModular [ $ modularName ] [ static :: CLASS_NAME_KEY ] ) ) { throw new InvalidModularException ( sprintf ( '%1$s %2$s has not found' , $ this -> modularParser -> getName ( ) , $ name ) ) ; } $ modular = new $ className ( $ this -> modularParser -> getContainer ( ) , $ modularName ) ; $ this -> validModular [ $ modularName ] = $ modular ; } if ( ! $ this -> validModular [ $ modularName ] instanceof ModularAbstract ) { unset ( $ this -> validModular [ $ modularName ] ) ; $ e = new InvalidModularException ( sprintf ( '%1$s %2$s Is not valid.' , $ this -> modularParser -> getName ( ) , $ name ) ) ; $ this -> invalidModular [ $ modularName ] = $ e ; throw $ e ; } return $ this -> validModular [ $ modularName ] ; }
Get Modular Given By Name

@access protected

@param string $name
@return ModularAbstract
@throws InvalidModularException
@throws Exception
Get Modular Given By Name