mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 11:38:44 +02:00
N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4 (#580)
* Update Symfony lib to version ~6.4.0 * Update code missing return type * Add an iTop general configuration entry to store application secret (Symfony mandatory parameter) * Use dependency injection in ExceptionListener & UserProvider classes
This commit is contained in:
@@ -26,43 +26,23 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
*/
|
||||
abstract class Descriptor implements DescriptorInterface
|
||||
{
|
||||
/**
|
||||
* @var OutputInterface
|
||||
*/
|
||||
protected $output;
|
||||
protected OutputInterface $output;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function describe(OutputInterface $output, object $object, array $options = [])
|
||||
public function describe(OutputInterface $output, object $object, array $options = []): void
|
||||
{
|
||||
$this->output = $output;
|
||||
|
||||
switch (true) {
|
||||
case $object instanceof InputArgument:
|
||||
$this->describeInputArgument($object, $options);
|
||||
break;
|
||||
case $object instanceof InputOption:
|
||||
$this->describeInputOption($object, $options);
|
||||
break;
|
||||
case $object instanceof InputDefinition:
|
||||
$this->describeInputDefinition($object, $options);
|
||||
break;
|
||||
case $object instanceof Command:
|
||||
$this->describeCommand($object, $options);
|
||||
break;
|
||||
case $object instanceof Application:
|
||||
$this->describeApplication($object, $options);
|
||||
break;
|
||||
default:
|
||||
throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_debug_type($object)));
|
||||
}
|
||||
match (true) {
|
||||
$object instanceof InputArgument => $this->describeInputArgument($object, $options),
|
||||
$object instanceof InputOption => $this->describeInputOption($object, $options),
|
||||
$object instanceof InputDefinition => $this->describeInputDefinition($object, $options),
|
||||
$object instanceof Command => $this->describeCommand($object, $options),
|
||||
$object instanceof Application => $this->describeApplication($object, $options),
|
||||
default => throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_debug_type($object))),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes content to output.
|
||||
*/
|
||||
protected function write(string $content, bool $decorated = false)
|
||||
protected function write(string $content, bool $decorated = false): void
|
||||
{
|
||||
$this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW);
|
||||
}
|
||||
@@ -70,25 +50,25 @@ abstract class Descriptor implements DescriptorInterface
|
||||
/**
|
||||
* Describes an InputArgument instance.
|
||||
*/
|
||||
abstract protected function describeInputArgument(InputArgument $argument, array $options = []);
|
||||
abstract protected function describeInputArgument(InputArgument $argument, array $options = []): void;
|
||||
|
||||
/**
|
||||
* Describes an InputOption instance.
|
||||
*/
|
||||
abstract protected function describeInputOption(InputOption $option, array $options = []);
|
||||
abstract protected function describeInputOption(InputOption $option, array $options = []): void;
|
||||
|
||||
/**
|
||||
* Describes an InputDefinition instance.
|
||||
*/
|
||||
abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []);
|
||||
abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []): void;
|
||||
|
||||
/**
|
||||
* Describes a Command instance.
|
||||
*/
|
||||
abstract protected function describeCommand(Command $command, array $options = []);
|
||||
abstract protected function describeCommand(Command $command, array $options = []): void;
|
||||
|
||||
/**
|
||||
* Describes an Application instance.
|
||||
*/
|
||||
abstract protected function describeApplication(Application $application, array $options = []);
|
||||
abstract protected function describeApplication(Application $application, array $options = []): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user