Skip to content

Commit 2ad0f1a

Browse files
Deprecations php 8.4
1 parent 6ac190e commit 2ad0f1a

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/CommandProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct($mode = self::MODE_DETECT)
3939
* @param array<string, scalar>|NULL $env
4040
* @return string
4141
*/
42-
public function process($app, array $args, array $env = NULL)
42+
public function process($app, array $args, ?array $env = NULL)
4343
{
4444
$cmd = [];
4545

src/GitRepository.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class GitRepository
1616
* @param string $repository
1717
* @throws GitException
1818
*/
19-
public function __construct($repository, IRunner $runner = NULL)
19+
public function __construct($repository, ?IRunner $runner = NULL)
2020
{
2121
if (basename($repository) === '.git') {
2222
$repository = dirname($repository);
@@ -466,7 +466,7 @@ public function hasChanges()
466466
* @return static
467467
* @throws GitException
468468
*/
469-
public function pull($remote = NULL, array $options = NULL)
469+
public function pull($remote = NULL, ?array $options = NULL)
470470
{
471471
$this->run('pull', $options, '--end-of-options', $remote);
472472
return $this;
@@ -480,7 +480,7 @@ public function pull($remote = NULL, array $options = NULL)
480480
* @return static
481481
* @throws GitException
482482
*/
483-
public function push($remote = NULL, array $options = NULL)
483+
public function push($remote = NULL, ?array $options = NULL)
484484
{
485485
$this->run('push', $options, '--end-of-options', $remote);
486486
return $this;
@@ -494,7 +494,7 @@ public function push($remote = NULL, array $options = NULL)
494494
* @return static
495495
* @throws GitException
496496
*/
497-
public function fetch($remote = NULL, array $options = NULL)
497+
public function fetch($remote = NULL, ?array $options = NULL)
498498
{
499499
$this->run('fetch', $options, '--end-of-options', $remote);
500500
return $this;
@@ -509,7 +509,7 @@ public function fetch($remote = NULL, array $options = NULL)
509509
* @return static
510510
* @throws GitException
511511
*/
512-
public function addRemote($name, $url, array $options = NULL)
512+
public function addRemote($name, $url, ?array $options = NULL)
513513
{
514514
$this->run('remote', 'add', $options, '--end-of-options', $name, $url);
515515
return $this;
@@ -551,7 +551,7 @@ public function removeRemote($name)
551551
* @return static
552552
* @throws GitException
553553
*/
554-
public function setRemoteUrl($name, $url, array $options = NULL)
554+
public function setRemoteUrl($name, $url, ?array $options = NULL)
555555
{
556556
$this->run('remote', 'set-url', $options, '--end-of-options', $name, $url);
557557
return $this;
@@ -593,7 +593,7 @@ public function run(...$args)
593593
* @return string[]|NULL
594594
* @throws GitException
595595
*/
596-
protected function extractFromCommand(array $args, callable $filter = NULL)
596+
protected function extractFromCommand(array $args, ?callable $filter = NULL)
597597
{
598598
$result = $this->run(...$args);
599599
$output = $result->getOutput();

src/Runners/CliRunner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct($gitBinary = 'git')
3030
/**
3131
* @return RunnerResult
3232
*/
33-
public function run($cwd, array $args, array $env = NULL)
33+
public function run($cwd, array $args, ?array $env = NULL)
3434
{
3535
if (!is_dir($cwd)) {
3636
throw new GitException("Directory '$cwd' not found");

src/Runners/MemoryRunner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function setResult(array $args, array $env, $output, $errorOutput = [], $
4949
/**
5050
* @return RunnerResult
5151
*/
52-
public function run($cwd, array $args, array $env = NULL)
52+
public function run($cwd, array $args, ?array $env = NULL)
5353
{
5454
$cmd = $this->commandProcessor->process('git', $args, $env);
5555

src/Runners/OldGitRunner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function __construct(IRunner $runner = NULL)
1717
}
1818

1919

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

0 commit comments

Comments
 (0)