Skip to content

Commit 3f2c75c

Browse files
committed
Fixed PHPStan errors
1 parent 20a1c1e commit 3f2c75c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/GitRepository.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ public function run(...$args)
590590

591591
/**
592592
* @param array<mixed> $args
593+
* @param (callable(string $value): (string|FALSE))|NULL $filter
593594
* @return string[]|NULL
594595
* @throws GitException
595596
*/

src/Runners/CliRunner.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ public function run($cwd, array $args, ?array $env = NULL)
5252
throw new GitException("Executing of command '$command' failed (directory $cwd).");
5353
}
5454

55+
if (!(is_array($pipes)
56+
&& isset($pipes[0], $pipes[1], $pipes[2])
57+
&& is_resource($pipes[0])
58+
&& is_resource($pipes[1])
59+
&& is_resource($pipes[2])
60+
)) {
61+
throw new GitException("Invalid pipes for command '$command' failed (directory $cwd).");
62+
}
63+
5564
// Reset output and error
5665
stream_set_blocking($pipes[1], FALSE);
5766
stream_set_blocking($pipes[2], FALSE);

0 commit comments

Comments
 (0)