12 namespace Symfony\Component\Console\Formatter;
45 $this->styles = array();
55 $this->styles[] = $style;
69 if (empty($this->styles)) {
73 if (null === $style) {
74 return array_pop($this->styles);
77 foreach (array_reverse($this->styles,
true) as $index => $stackedStyle) {
78 if ($style->apply(
'') === $stackedStyle->apply(
'')) {
79 $this->styles = array_slice($this->styles, 0, $index);
85 throw new \InvalidArgumentException(
'Incorrectly nested style tag found.');
95 if (empty($this->styles)) {
99 return $this->styles[count($this->styles) - 1];