src/Decorator/Parser/Ansi.php
protected function parseTags($str, $tags)
    {
        // Let's keep a history of styles applied
        $history = ($this->currentCode()) ? [$this->currentCode()] : [];

        foreach ($tags as $tag) {
            $str = $this->replaceTag($str, $tag, $history);
        }

        return $str;
    }
protected function parseTags($str, $tags)
    {
        // Let's keep a history of styles applied
        $history = ($this->currentCode()) ? [$this->currentCode()] : [];

        foreach ($tags as $tag) {
            $str = $this->replaceTag($str, $tag, $history);
        }

        return $str;
    }
protected function parseTags ( $ str , $ tags ) { // Let's keep a history of styles applied $ history = ( $ this -> currentCode ( ) ) ? [ $ this -> currentCode ( ) ] : [ ] ; foreach ( $ tags as $ tag ) { $ str = $ this -> replaceTag ( $ str , $ tag , $ history ) ; } return $ str ; }
Parse the given string for the tags and replace them with the appropriate codes

@param string $str
@param array $tags

@return string
Parse the given string for the tags and replace them with the appropriate codes