diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-04-12 17:55:01 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-05-20 22:18:06 +0200 |
commit | b70c6a128fe5d0053b7971881696eafce4cb7c26 (patch) | |
tree | 641ff76531803c207a92d86f47d46b6dd93ab6d3 /core/Command/Base.php | |
parent | 2b0d82675f669f00ad90f2750b1832a60ec9f766 (diff) | |
download | nextcloud-server-b70c6a128fe5d0053b7971881696eafce4cb7c26.tar.gz nextcloud-server-b70c6a128fe5d0053b7971881696eafce4cb7c26.zip |
Update core to PHP 7.4 standard
- Typed properties
- Port to LoggerInterface
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'core/Command/Base.php')
-rw-r--r-- | core/Command/Base.php | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/core/Command/Base.php b/core/Command/Base.php index 029942c0673..d228e362447 100644 --- a/core/Command/Base.php +++ b/core/Command/Base.php @@ -38,13 +38,9 @@ class Base extends Command implements CompletionAwareInterface { public const OUTPUT_FORMAT_JSON = 'json'; public const OUTPUT_FORMAT_JSON_PRETTY = 'json_pretty'; - protected $defaultOutputFormat = self::OUTPUT_FORMAT_PLAIN; - - /** @var boolean */ - private $php_pcntl_signal = false; - - /** @var boolean */ - private $interrupted = false; + protected string $defaultOutputFormat = self::OUTPUT_FORMAT_PLAIN; + private bool $php_pcntl_signal = false; + private bool $interrupted = false; protected function configure() { $this @@ -58,13 +54,7 @@ class Base extends Command implements CompletionAwareInterface { ; } - /** - * @param InputInterface $input - * @param OutputInterface $output - * @param array $items - * @param string $prefix - */ - protected function writeArrayInOutputFormat(InputInterface $input, OutputInterface $output, $items, $prefix = ' - ') { + protected function writeArrayInOutputFormat(InputInterface $input, OutputInterface $output, array $items, string $prefix = ' - ') { switch ($input->getOption('output')) { case self::OUTPUT_FORMAT_JSON: $output->writeln(json_encode($items)); @@ -95,8 +85,6 @@ class Base extends Command implements CompletionAwareInterface { } /** - * @param InputInterface $input - * @param OutputInterface $output * @param mixed $item */ protected function writeMixedInOutputFormat(InputInterface $input, OutputInterface $output, $item) { @@ -118,7 +106,7 @@ class Base extends Command implements CompletionAwareInterface { } } - protected function valueToString($value, $returnNull = true) { + protected function valueToString($value, bool $returnNull = true): ?string { if ($value === false) { return 'false'; } elseif ($value === true) { |