public function __construct($out = null, $verbose = false, $colors = self::COLOR_DEFAULT, $debug = false, $numberOfColumns = 80, $reverse = false)
{
parent::__construct($out);
if (!is_bool($verbose)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'boolean');
}
$availableColors = [self::COLOR_NEVER, self::COLOR_AUTO, self::COLOR_ALWAYS];
if (!in_array($colors, $availableColors)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(3, vsprintf('value from "%s", "%s" or "%s"', $availableColors));
}
if (!is_bool($debug)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(4, 'boolean');
}
if (!is_int($numberOfColumns) && $numberOfColumns != 'max') {
throw PHPUnit_Util_InvalidArgumentHelper::factory(5, 'integer or "max"');
}
if (!is_bool($reverse)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(6, 'boolean');
}
$console = new Console();
$maxNumberOfColumns = $console->getNumberOfColumns();
if ($numberOfColumns == 'max' || $numberOfColumns > $maxNumberOfColumns) {
$numberOfColumns = $maxNumberOfColumns;
}
$this->numberOfColumns = $numberOfColumns;
$this->verbose = $verbose;
$this->debug = $debug;
$this->reverse = $reverse;
if ($colors === self::COLOR_AUTO && $console->hasColorSupport()) {
$this->colors = true;
} else {
$this->colors = self::COLOR_ALWAYS === $colors;
}
}