symfony/symfony — pull request #3613 by jfsimon (2012-03-16 09:40:15+00:00)
Title: [Console] Fixes formatter nested style appliance.

Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes

When outputing styled text in the console, you sometimes face to a confusing behavior: style tags cannot be nested. If tou try something like Hello world!, the trailing ! will not be styled.

This PR introduce a new FormatterOutputStyleStack to keep open/closed styles informations up-to-date. It slightly changes OutputFormatter implementation which no longer uses `OutputFormatterStyle::apply()` method, but the new `OutputFormatterStyle::getTerminalSequence()`.

**Question:** In order to make it work, I needed to add some getters in `OutputFormatterStyleInterface` which is marked as `@Api`. Do you think it's OK?

**Notice:** I also needed to fix some tests broken by new implementation.