Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid implicit nullable types (PHP 8.4 compatibility) #17

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Command/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
10 changes: 5 additions & 5 deletions src/Command/Runner/Simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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());

Expand Down
Loading