public function process($string)
    {
        preg_match_all($this->tagFilter, $string, $matches);

        if (!$matches) {
            return $string;
        }

        foreach ($matches[0] as $i => $m) {
            if (array_key_exists($matches[1][$i], $this->styles)) {
                $string = $this->replaceColors(
                    $string,
                    $matches[1][$i],
                    $matches[2][$i],
                    $this->styles[$matches[1][$i]]
                );
            } elseif (strpos($matches[1][$i], '=')) {
                // Custom format
                $string = $this->replaceColors(
                    $string,
                    $matches[1][$i],
                    $matches[2][$i],
                    ColorStyle::fromString($matches[1][$i])
                );
            }
        }

        return $string;
    }
public function process($string)
    {
        preg_match_all($this->tagFilter, $string, $matches);

        if (!$matches) {
            return $string;
        }

        foreach ($matches[0] as $i => $m) {
            if (array_key_exists($matches[1][$i], $this->styles)) {
                $string = $this->replaceColors(
                    $string,
                    $matches[1][$i],
                    $matches[2][$i],
                    $this->styles[$matches[1][$i]]
                );
            } elseif (strpos($matches[1][$i], '=')) {
                // Custom format
                $string = $this->replaceColors(
                    $string,
                    $matches[1][$i],
                    $matches[2][$i],
                    ColorStyle::fromString($matches[1][$i])
                );
            }
        }

        return $string;
    }
public function process ( $ string ) { preg_match_all ( $ this -> tagFilter , $ string , $ matches ) ; if ( ! $ matches ) { return $ string ; } foreach ( $ matches [ 0 ] as $ i => $ m ) { if ( array_key_exists ( $ matches [ 1 ] [ $ i ] , $ this -> styles ) ) { $ string = $ this -> replaceColors ( $ string , $ matches [ 1 ] [ $ i ] , $ matches [ 2 ] [ $ i ] , $ this -> styles [ $ matches [ 1 ] [ $ i ] ] ) ; } elseif ( strpos ( $ matches [ 1 ] [ $ i ] , '=' ) ) { // Custom format $ string = $ this -> replaceColors ( $ string , $ matches [ 1 ] [ $ i ] , $ matches [ 2 ] [ $ i ] , ColorStyle :: fromString ( $ matches [ 1 ] [ $ i ] ) ) ; } } return $ string ; }
Process a string.

@param   string $string The string to process.

@return  string

@since   2.0
Process a string .