Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Console] Moved message formatting routines into separate object #312

Merged
merged 8 commits into from Mar 18, 2011

Conversation

@everzet
Copy link
Contributor

everzet commented Mar 17, 2011

Splitted actual Console Output class into 3 different logical objects:

  1. OutputFormatterStyle
  2. OutputFormatter
  3. Output

First 2 is for formatter configuration and message decoration. Third is actual output writer. This change eliminates all privatisation problems and makes output logic much cleaner

I know, we don't accept BC breaks from now on. But i've tried hard to not add BC breaks with this really helpful update. It would be very cool for Symfony2, Behat, and other project's developers if you could merge this.

*/
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null)
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null,
OutputFormatter $formatter = null)

This comment has been minimized.

@stof

stof Mar 17, 2011 Member

This should be on the same line. method arguments are not splitted on several lines in the framework.

This comment has been minimized.

@everzet

everzet Mar 17, 2011 Author Contributor

Ok. Didn't know that.

static private $options = array('bold' => 1, 'underscore' => 4, 'blink' => 5, 'reverse' => 7, 'conceal' => 8);
static private $foreground = array('black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37);
static private $background = array('black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47);
protected $formatter;

This comment has been minimized.

@stof

stof Mar 17, 2011 Member

Why not using a private one as there is a getter ?

This comment has been minimized.

@everzet

everzet Mar 17, 2011 Author Contributor

You're right. I've just copied it from the old Output

*
* @throws \InvalidArgumentException When first argument is not a real stream
*/
public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null)
public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null,
OutputFormatter $formatter = null)

This comment has been minimized.

@stof

stof Mar 17, 2011 Member

Same than above.

@fabpot fabpot merged commit 3e7fa82 into symfony:master Mar 18, 2011
jderusse pushed a commit to jderusse/symfony that referenced this pull request Mar 30, 2020
Add CVE-2015-5243: phpWhois PHP Code Injection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.