[Console] fix abstract Output class that fasly claims to support guessing of decorated variable.

Also we don't need to typecast to boolean as its already done by the formatter and its his responsibility
This commit is contained in:
Tobias Schultze 2013-05-14 18:18:10 +02:00
parent 2628d889a7
commit 9dcc9facf0
1 changed files with 4 additions and 4 deletions

View File

@ -36,16 +36,16 @@ abstract class Output implements OutputInterface
* Constructor.
*
* @param integer $verbosity The verbosity level (self::VERBOSITY_QUIET, self::VERBOSITY_NORMAL, self::VERBOSITY_VERBOSE)
* @param Boolean $decorated Whether to decorate messages or not (null for auto-guessing)
* @param Boolean $decorated Whether to decorate messages or not
* @param OutputFormatterInterface $formatter Output formatter instance
*
* @api
*/
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = false, OutputFormatterInterface $formatter = null)
{
$this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity;
$this->formatter = null === $formatter ? new OutputFormatter() : $formatter;
$this->formatter->setDecorated((Boolean) $decorated);
$this->formatter->setDecorated($decorated);
}
/**
@ -81,7 +81,7 @@ abstract class Output implements OutputInterface
*/
public function setDecorated($decorated)
{
$this->formatter->setDecorated((Boolean) $decorated);
$this->formatter->setDecorated($decorated);
}
/**