- md5
- 02fea99a2cbebf00915196ab3563349f
- sha1
- bb6b40a0a807ad47ae90f245d03b28a1cf3eda02
- sha256
- 02c507168e6948eeadca8398bae4677730793e3c58a3354b74c625ac51ee41bf
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Style;
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Decorates output to add console style guide helpers.
*
* @author Kevin Bond <[email protected]>
*/
abstract class OutputStyle implements OutputInterface, StyleInterface
{
private OutputInterface $output;
public function __construct(OutputInterface $output)
{
$this->output = $output;
}
/**
* @return void
*/
public function newLine(int $count = 1)
{
$this->output->write(str_repeat(\PHP_EOL, $count));
}
public function createProgressBar(int $max = 0): ProgressBar
{
return new ProgressBar($this->output, $max);
}
/**
* @return void
*/
public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL)
{
$this->output->write($messages, $newline, $type);
}
/**
* @return void
*/
public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL)
{
$this->output->writeln($messages, $type);
}
/**
* @return void
*/
public function setVerbosity(int $level)
{
$this->output->setVerbosity($level);
}
public function getVerbosity(): int
{
return $this->output->getVerbosity();
}
/**
* @return void
*/
public function setDecorated(bool $decorated)
{
$this->output->setDecorated($decorated);
}
public function isDecorated(): bool
{
return $this->output->isDecorated();
}
/**
* @return void
*/
public function setFormatter(OutputFormatterInterface $formatter)
{
$this->output->setFormatter($formatter);
}
public function getFormatter(): OutputFormatterInterface
{
return $this->output->getFormatter();
}
public function isQuiet(): bool
{
return $this->output->isQuiet();
}
public function isVerbose(): bool
{
return $this->output->isVerbose();
}
public function isVeryVerbose(): bool
{
return $this->output->isVeryVerbose();
}
public function isDebug(): bool
{
return $this->output->isDebug();
}
/**
* @return OutputInterface
*/
protected function getErrorOutput()
{
if (!$this->output instanceof ConsoleOutputInterface) {
return $this->output;
}
return $this->output->getErrorOutput();
}
}
The same content is in 107 releases, Joomla 5.0.0-alpha2 to 6.0.0-alpha3. See them all, or every version of this file.