From 11064f7d0625222a5f0336260f17eea4b4ae60bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Tue, 26 Nov 2024 08:10:17 +0100 Subject: [PATCH] Avoid implicit nullable types (PHP 8.4 compatibility) --- src/Command/Runner.php | 6 +++--- src/Command/Runner/Simple.php | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Command/Runner.php b/src/Command/Runner.php index c4a313b..b20d3c1 100644 --- a/src/Command/Runner.php +++ b/src/Command/Runner.php @@ -27,9 +27,9 @@ interface Runner /** * Execute a command. * - * @param \SebastianFeldmann\Cli\Command $command - * @param \SebastianFeldmann\Cli\Command\OutputFormatter $formatter + * @param \SebastianFeldmann\Cli\Command $command + * @param \SebastianFeldmann\Cli\Command\OutputFormatter|null $formatter * @return \SebastianFeldmann\Cli\Command\Runner\Result */ - public function run(Command $command, OutputFormatter $formatter = null): RunnerResult; + public function run(Command $command, ?OutputFormatter $formatter = null): RunnerResult; } diff --git a/src/Command/Runner/Simple.php b/src/Command/Runner/Simple.php index fee96e9..034c9bc 100644 --- a/src/Command/Runner/Simple.php +++ b/src/Command/Runner/Simple.php @@ -37,9 +37,9 @@ class Simple implements Runner /** * Exec constructor. * - * @param \SebastianFeldmann\Cli\Processor $processor + * @param \SebastianFeldmann\Cli\Processor|null $processor */ - public function __construct(Processor $processor = null) + public function __construct(?Processor $processor = null) { $this->processor = $processor !== null ? $processor @@ -49,11 +49,11 @@ public function __construct(Processor $processor = null) /** * Execute a cli command. * - * @param \SebastianFeldmann\Cli\Command $command - * @param \SebastianFeldmann\Cli\Command\OutputFormatter $formatter + * @param \SebastianFeldmann\Cli\Command $command + * @param \SebastianFeldmann\Cli\Command\OutputFormatter|null $formatter * @return \SebastianFeldmann\Cli\Command\Runner\Result */ - public function run(Command $command, OutputFormatter $formatter = null): Result + public function run(Command $command, ?OutputFormatter $formatter = null): Result { $cmd = $this->processor->run($command->getCommand(), $command->getAcceptableExitCodes());