mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-27 12:38:44 +02:00
migration symfony 5 4 (#300)
* symfony 5.4 (diff dev) * symfony 5.4 (working) * symfony 5.4 (update autoload) * symfony 5.4 (remove swiftmailer mailer implementation) * symfony 5.4 (php doc and split Global accessor class) ### Impacted packages: composer require php:">=7.2.5 <8.0.0" symfony/console:5.4.* symfony/dotenv:5.4.* symfony/framework-bundle:5.4.* symfony/twig-bundle:5.4.* symfony/yaml:5.4.* --update-with-dependencies composer require symfony/stopwatch:5.4.* symfony/web-profiler-bundle:5.4.* --dev --update-with-dependencies
This commit is contained in:
@@ -33,14 +33,14 @@ abstract class Output implements OutputInterface
|
||||
private $formatter;
|
||||
|
||||
/**
|
||||
* @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
|
||||
* @param int|null $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
|
||||
* @param bool $decorated Whether to decorate messages
|
||||
* @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter)
|
||||
*/
|
||||
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = false, OutputFormatterInterface $formatter = null)
|
||||
public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null)
|
||||
{
|
||||
$this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity;
|
||||
$this->formatter = $formatter ?: new OutputFormatter();
|
||||
$this->verbosity = $verbosity ?? self::VERBOSITY_NORMAL;
|
||||
$this->formatter = $formatter ?? new OutputFormatter();
|
||||
$this->formatter->setDecorated($decorated);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ abstract class Output implements OutputInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setDecorated($decorated)
|
||||
public function setDecorated(bool $decorated)
|
||||
{
|
||||
$this->formatter->setDecorated($decorated);
|
||||
}
|
||||
@@ -79,9 +79,9 @@ abstract class Output implements OutputInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setVerbosity($level)
|
||||
public function setVerbosity(int $level)
|
||||
{
|
||||
$this->verbosity = (int) $level;
|
||||
$this->verbosity = $level;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,7 +127,7 @@ abstract class Output implements OutputInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function writeln($messages, $options = self::OUTPUT_NORMAL)
|
||||
public function writeln($messages, int $options = self::OUTPUT_NORMAL)
|
||||
{
|
||||
$this->write($messages, true, $options);
|
||||
}
|
||||
@@ -135,9 +135,11 @@ abstract class Output implements OutputInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function write($messages, $newline = false, $options = self::OUTPUT_NORMAL)
|
||||
public function write($messages, bool $newline = false, int $options = self::OUTPUT_NORMAL)
|
||||
{
|
||||
$messages = (array) $messages;
|
||||
if (!is_iterable($messages)) {
|
||||
$messages = [$messages];
|
||||
}
|
||||
|
||||
$types = self::OUTPUT_NORMAL | self::OUTPUT_RAW | self::OUTPUT_PLAIN;
|
||||
$type = $types & $options ?: self::OUTPUT_NORMAL;
|
||||
@@ -161,15 +163,12 @@ abstract class Output implements OutputInterface
|
||||
break;
|
||||
}
|
||||
|
||||
$this->doWrite($message, $newline);
|
||||
$this->doWrite($message ?? '', $newline);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a message to the output.
|
||||
*
|
||||
* @param string $message A message to write to the output
|
||||
* @param bool $newline Whether to add a newline or not
|
||||
*/
|
||||
abstract protected function doWrite($message, $newline);
|
||||
abstract protected function doWrite(string $message, bool $newline);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user