private function _do_never_allowed(string $str): string
    {
        static $NEVER_ALLOWED_CACHE = [];

        $NEVER_ALLOWED_CACHE['keys'] = null;
        $NEVER_ALLOWED_CACHE['regex'] = null;

        if ($NEVER_ALLOWED_CACHE['keys'] === null) {
            $NEVER_ALLOWED_CACHE['keys'] = \array_keys($this->_never_allowed_str);
        }

        $str = \str_ireplace(
            $NEVER_ALLOWED_CACHE['keys'],
            $this->_never_allowed_str,
            $str
        );

        // ---

        foreach (self::$_never_allowed_call as $call) {
            if (\stripos($str, $call) !== false) {
                $str = (string) \preg_replace(
                    '#([^\p{L}]|^)' . $call . '\s*:#ius',
                    '$1' . $this->_replacement,
                    $str
                );
            }
        }

        // ---

        if ($NEVER_ALLOWED_CACHE['regex'] === null) {
            $NEVER_ALLOWED_CACHE['regex'] = \implode('|', self::$_never_allowed_regex);
        }

        $str = (string) \preg_replace(
            '#' . $NEVER_ALLOWED_CACHE['regex'] . '#ius',
            $this->_replacement,
            $str
        );

        return $str;
    }
private function _do_never_allowed(string $str): string
    {
        static $NEVER_ALLOWED_CACHE = [];

        $NEVER_ALLOWED_CACHE['keys'] = null;
        $NEVER_ALLOWED_CACHE['regex'] = null;

        if ($NEVER_ALLOWED_CACHE['keys'] === null) {
            $NEVER_ALLOWED_CACHE['keys'] = \array_keys($this->_never_allowed_str);
        }

        $str = \str_ireplace(
            $NEVER_ALLOWED_CACHE['keys'],
            $this->_never_allowed_str,
            $str
        );

        // ---

        foreach (self::$_never_allowed_call as $call) {
            if (\stripos($str, $call) !== false) {
                $str = (string) \preg_replace(
                    '#([^\p{L}]|^)' . $call . '\s*:#ius',
                    '$1' . $this->_replacement,
                    $str
                );
            }
        }

        // ---

        if ($NEVER_ALLOWED_CACHE['regex'] === null) {
            $NEVER_ALLOWED_CACHE['regex'] = \implode('|', self::$_never_allowed_regex);
        }

        $str = (string) \preg_replace(
            '#' . $NEVER_ALLOWED_CACHE['regex'] . '#ius',
            $this->_replacement,
            $str
        );

        return $str;
    }
private function _do_never_allowed ( string $ str ) : string { static $ NEVER_ALLOWED_CACHE = [ ] ; $ NEVER_ALLOWED_CACHE [ 'keys' ] = null ; $ NEVER_ALLOWED_CACHE [ 'regex' ] = null ; if ( $ NEVER_ALLOWED_CACHE [ 'keys' ] === null ) { $ NEVER_ALLOWED_CACHE [ 'keys' ] = \ array_keys ( $ this -> _never_allowed_str ) ; } $ str = \ str_ireplace ( $ NEVER_ALLOWED_CACHE [ 'keys' ] , $ this -> _never_allowed_str , $ str ) ; // --- foreach ( self :: $ _never_allowed_call as $ call ) { if ( \ stripos ( $ str , $ call ) !== false ) { $ str = ( string ) \ preg_replace ( '#([^\p{L}]|^)' . $ call . '\s*:#ius' , '$1' . $ this -> _replacement , $ str ) ; } } // --- if ( $ NEVER_ALLOWED_CACHE [ 'regex' ] === null ) { $ NEVER_ALLOWED_CACHE [ 'regex' ] = \ implode ( '|' , self :: $ _never_allowed_regex ) ; } $ str = ( string ) \ preg_replace ( '#' . $ NEVER_ALLOWED_CACHE [ 'regex' ] . '#ius' , $ this -> _replacement , $ str ) ; return $ str ; }
Remove never allowed strings.

@param string $str

@return string
Remove never allowed strings .