private function getStyleStack($string)
    {
        if (preg_match_all(static::REGEX_FORMAT, $string, $matches)) {
            foreach ($matches[1] as $grouping) {
                if (preg_match_all(static::REGEX_STYLE_ITEM, $grouping, $styles)) {
                    foreach ($styles[0] as $style) {
                        yield $style;
                    }
                } else {
                    yield static::STYLE_RESET;
                }
            }
        }
        return;
    }
private function getStyleStack($string)
    {
        if (preg_match_all(static::REGEX_FORMAT, $string, $matches)) {
            foreach ($matches[1] as $grouping) {
                if (preg_match_all(static::REGEX_STYLE_ITEM, $grouping, $styles)) {
                    foreach ($styles[0] as $style) {
                        yield $style;
                    }
                } else {
                    yield static::STYLE_RESET;
                }
            }
        }
        return;
    }
private function getStyleStack ( $ string ) { if ( preg_match_all ( static :: REGEX_FORMAT , $ string , $ matches ) ) { foreach ( $ matches [ 1 ] as $ grouping ) { if ( preg_match_all ( static :: REGEX_STYLE_ITEM , $ grouping , $ styles ) ) { foreach ( $ styles [ 0 ] as $ style ) { yield $ style ; } } else { yield static :: STYLE_RESET ; } } } return ; }
Get all the styles in order that should be applied at the end

@param string $string

@return \Generator|void Iterator of numbers representing styles
Get all the styles in order that should be applied at the end