Skip to content

Commit

Permalink
PHP 8.4 compatibility: implicitly nullable parameter declarations dep…
Browse files Browse the repository at this point in the history
…recated

Ref drush-ops/drush#6069
  • Loading branch information
andypost committed Jul 23, 2024
1 parent c7d8b4d commit 25089b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ProcessBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function setLogger($logger)
/**
* @inheritDoc
*/
public function start(callable $callback = null, array $env = []): void
public function start(?callable $callback = null, array $env = []): void
{
$cmd = $this->getCommandLine();
if ($this->isSimulated()) {
Expand Down
4 changes: 2 additions & 2 deletions src/ProcessManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function siteProcess(SiteAliasInterface $siteAlias, $args = [], $options
* @param int|float|null $timeout The timeout in seconds or null to disable
* @return Process
*/
public function process($command, $cwd = null, array $env = null, $input = null, $timeout = 60)
public function process($command, $cwd = null, ?array $env = null, $input = null, $timeout = 60)
{
return new ProcessBase($command, $cwd, $env, $input, $timeout);
}
Expand All @@ -117,7 +117,7 @@ public function process($command, $cwd = null, array $env = null, $input = null,
* @param int|float|null $timeout The timeout in seconds or null to disable
* @return Process
*/
public function shell($command, $cwd = null, array $env = null, $input = null, $timeout = 60)
public function shell($command, $cwd = null, ?array $env = null, $input = null, $timeout = 60)
{
return ProcessBase::fromShellCommandline($command, $cwd, $env, $input, $timeout);
}
Expand Down
6 changes: 3 additions & 3 deletions src/SiteProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,13 @@ public function getCommandLine(): string
/**
* @inheritDoc
*/
public function start(callable $callback = null, array $env = []): void
public function start(?callable $callback = null, array $env = []): void
{
$cmd = $this->getCommandLine();
parent::start($callback, $env);
}

public function mustRun(callable $callback = null, array $env = []): static
public function mustRun(?callable $callback = null, array $env = []): static
{
if (0 !== $this->run($callback, $env)) {
// Be less verbose when there is nothing in stdout or stderr.
Expand All @@ -220,7 +220,7 @@ public function mustRun(callable $callback = null, array $env = []): static
/**
* @inheritDoc
*/
public function wait(callable $callback = null): int
public function wait(?callable $callback = null): int
{
$return = parent::wait($callback);
return $return;
Expand Down

0 comments on commit 25089b6

Please sign in to comment.