Skip to content

Commit

Permalink
Deprecations php 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Damienbelingheri authored Jan 20, 2025
1 parent 6ac190e commit 2ad0f1a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/CommandProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct($mode = self::MODE_DETECT)
* @param array<string, scalar>|NULL $env
* @return string
*/
public function process($app, array $args, array $env = NULL)
public function process($app, array $args, ?array $env = NULL)
{
$cmd = [];

Expand Down
14 changes: 7 additions & 7 deletions src/GitRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class GitRepository
* @param string $repository
* @throws GitException
*/
public function __construct($repository, IRunner $runner = NULL)
public function __construct($repository, ?IRunner $runner = NULL)
{
if (basename($repository) === '.git') {
$repository = dirname($repository);
Expand Down Expand Up @@ -466,7 +466,7 @@ public function hasChanges()
* @return static
* @throws GitException
*/
public function pull($remote = NULL, array $options = NULL)
public function pull($remote = NULL, ?array $options = NULL)
{
$this->run('pull', $options, '--end-of-options', $remote);
return $this;
Expand All @@ -480,7 +480,7 @@ public function pull($remote = NULL, array $options = NULL)
* @return static
* @throws GitException
*/
public function push($remote = NULL, array $options = NULL)
public function push($remote = NULL, ?array $options = NULL)
{
$this->run('push', $options, '--end-of-options', $remote);
return $this;
Expand All @@ -494,7 +494,7 @@ public function push($remote = NULL, array $options = NULL)
* @return static
* @throws GitException
*/
public function fetch($remote = NULL, array $options = NULL)
public function fetch($remote = NULL, ?array $options = NULL)
{
$this->run('fetch', $options, '--end-of-options', $remote);
return $this;
Expand All @@ -509,7 +509,7 @@ public function fetch($remote = NULL, array $options = NULL)
* @return static
* @throws GitException
*/
public function addRemote($name, $url, array $options = NULL)
public function addRemote($name, $url, ?array $options = NULL)
{
$this->run('remote', 'add', $options, '--end-of-options', $name, $url);
return $this;
Expand Down Expand Up @@ -551,7 +551,7 @@ public function removeRemote($name)
* @return static
* @throws GitException
*/
public function setRemoteUrl($name, $url, array $options = NULL)
public function setRemoteUrl($name, $url, ?array $options = NULL)
{
$this->run('remote', 'set-url', $options, '--end-of-options', $name, $url);
return $this;
Expand Down Expand Up @@ -593,7 +593,7 @@ public function run(...$args)
* @return string[]|NULL
* @throws GitException
*/
protected function extractFromCommand(array $args, callable $filter = NULL)
protected function extractFromCommand(array $args, ?callable $filter = NULL)
{
$result = $this->run(...$args);
$output = $result->getOutput();
Expand Down
2 changes: 1 addition & 1 deletion src/Runners/CliRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct($gitBinary = 'git')
/**
* @return RunnerResult
*/
public function run($cwd, array $args, array $env = NULL)
public function run($cwd, array $args, ?array $env = NULL)
{
if (!is_dir($cwd)) {
throw new GitException("Directory '$cwd' not found");
Expand Down
2 changes: 1 addition & 1 deletion src/Runners/MemoryRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function setResult(array $args, array $env, $output, $errorOutput = [], $
/**
* @return RunnerResult
*/
public function run($cwd, array $args, array $env = NULL)
public function run($cwd, array $args, ?array $env = NULL)
{
$cmd = $this->commandProcessor->process('git', $args, $env);

Expand Down
2 changes: 1 addition & 1 deletion src/Runners/OldGitRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(IRunner $runner = NULL)
}


public function run($cwd, array $args, array $env = NULL)
public function run($cwd, array $args, ?array $env = NULL)
{
if (($key = array_search('--end-of-options', $args)) !== FALSE) {
unset($args[$key]);
Expand Down

0 comments on commit 2ad0f1a

Please sign in to comment.