Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 937a195

Browse files
Merge branch '6.4' into 7.0
* 6.4: Fix implicitly-required parameters minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench) Fix bad merge List CS fix in .git-blame-ignore-revs Fix implicitly-required parameters List CS fix in .git-blame-ignore-revs Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2 parents c9920b0 + 31642b0 commit 937a195

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

ExecutableFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function addSuffix(string $suffix): void
4444
* @param string|null $default The default to return if no executable is found
4545
* @param array $extraDirs Additional dirs to check into
4646
*/
47-
public function find(string $name, string $default = null, array $extraDirs = []): ?string
47+
public function find(string $name, ?string $default = null, array $extraDirs = []): ?string
4848
{
4949
$dirs = array_merge(
5050
explode(\PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')),

InputStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class InputStream implements \IteratorAggregate
2929
/**
3030
* Sets a callback that is called when the write buffer becomes empty.
3131
*/
32-
public function onEmpty(callable $onEmpty = null): void
32+
public function onEmpty(?callable $onEmpty = null): void
3333
{
3434
$this->onEmpty = null !== $onEmpty ? $onEmpty(...) : null;
3535
}

PhpProcess.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PhpProcess extends Process
3232
* @param int $timeout The timeout in seconds
3333
* @param array|null $php Path to the PHP binary to use with any additional arguments
3434
*/
35-
public function __construct(string $script, string $cwd = null, array $env = null, int $timeout = 60, array $php = null)
35+
public function __construct(string $script, ?string $cwd = null, ?array $env = null, int $timeout = 60, ?array $php = null)
3636
{
3737
if (null === $php) {
3838
$executableFinder = new PhpExecutableFinder();
@@ -50,12 +50,12 @@ public function __construct(string $script, string $cwd = null, array $env = nul
5050
parent::__construct($php, $cwd, $env, $script, $timeout);
5151
}
5252

53-
public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60): static
53+
public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static
5454
{
5555
throw new LogicException(sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class));
5656
}
5757

58-
public function start(callable $callback = null, array $env = []): void
58+
public function start(?callable $callback = null, array $env = []): void
5959
{
6060
if (null === $this->getCommandLine()) {
6161
throw new RuntimeException('Unable to find the PHP executable.');

PhpSubprocess.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class PhpSubprocess extends Process
5151
* @param int $timeout The timeout in seconds
5252
* @param array|null $php Path to the PHP binary to use with any additional arguments
5353
*/
54-
public function __construct(array $command, string $cwd = null, array $env = null, int $timeout = 60, array $php = null)
54+
public function __construct(array $command, ?string $cwd = null, ?array $env = null, int $timeout = 60, ?array $php = null)
5555
{
5656
if (null === $php) {
5757
$executableFinder = new PhpExecutableFinder();
@@ -73,12 +73,12 @@ public function __construct(array $command, string $cwd = null, array $env = nul
7373
parent::__construct($command, $cwd, $env, null, $timeout);
7474
}
7575

76-
public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60): static
76+
public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static
7777
{
7878
throw new LogicException(sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class));
7979
}
8080

81-
public function start(callable $callback = null, array $env = []): void
81+
public function start(?callable $callback = null, array $env = []): void
8282
{
8383
if (null === $this->getCommandLine()) {
8484
throw new RuntimeException('Unable to find the PHP executable.');

Process.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class Process implements \IteratorAggregate
140140
*
141141
* @throws LogicException When proc_open is not installed
142142
*/
143-
public function __construct(array $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60)
143+
public function __construct(array $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60)
144144
{
145145
if (!\function_exists('proc_open')) {
146146
throw new LogicException('The Process class relies on proc_open, which is not available on your PHP installation.');
@@ -186,7 +186,7 @@ public function __construct(array $command, string $cwd = null, array $env = nul
186186
*
187187
* @throws LogicException When proc_open is not installed
188188
*/
189-
public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60): static
189+
public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static
190190
{
191191
$process = new static([], $cwd, $env, $input, $timeout);
192192
$process->commandline = $command;
@@ -241,7 +241,7 @@ public function __clone()
241241
*
242242
* @final
243243
*/
244-
public function run(callable $callback = null, array $env = []): int
244+
public function run(?callable $callback = null, array $env = []): int
245245
{
246246
$this->start($callback, $env);
247247

@@ -260,7 +260,7 @@ public function run(callable $callback = null, array $env = []): int
260260
*
261261
* @final
262262
*/
263-
public function mustRun(callable $callback = null, array $env = []): static
263+
public function mustRun(?callable $callback = null, array $env = []): static
264264
{
265265
if (0 !== $this->run($callback, $env)) {
266266
throw new ProcessFailedException($this);
@@ -288,7 +288,7 @@ public function mustRun(callable $callback = null, array $env = []): static
288288
* @throws RuntimeException When process is already running
289289
* @throws LogicException In case a callback is provided and output has been disabled
290290
*/
291-
public function start(callable $callback = null, array $env = []): void
291+
public function start(?callable $callback = null, array $env = []): void
292292
{
293293
if ($this->isRunning()) {
294294
throw new RuntimeException('Process is already running.');
@@ -373,7 +373,7 @@ public function start(callable $callback = null, array $env = []): void
373373
*
374374
* @final
375375
*/
376-
public function restart(callable $callback = null, array $env = []): static
376+
public function restart(?callable $callback = null, array $env = []): static
377377
{
378378
if ($this->isRunning()) {
379379
throw new RuntimeException('Process is already running.');
@@ -400,7 +400,7 @@ public function restart(callable $callback = null, array $env = []): static
400400
* @throws ProcessSignaledException When process stopped after receiving signal
401401
* @throws LogicException When process is not yet started
402402
*/
403-
public function wait(callable $callback = null): int
403+
public function wait(?callable $callback = null): int
404404
{
405405
$this->requireProcessIsStarted(__FUNCTION__);
406406

@@ -873,7 +873,7 @@ public function getStatus(): string
873873
*
874874
* @return int|null The exit-code of the process or null if it's not running
875875
*/
876-
public function stop(float $timeout = 10, int $signal = null): ?int
876+
public function stop(float $timeout = 10, ?int $signal = null): ?int
877877
{
878878
$timeoutMicro = microtime(true) + $timeout;
879879
if ($this->isRunning()) {
@@ -1247,7 +1247,7 @@ private function getDescriptors(bool $hasCallback): array
12471247
*
12481248
* @param callable|null $callback The user defined PHP callback
12491249
*/
1250-
protected function buildCallback(callable $callback = null): \Closure
1250+
protected function buildCallback(?callable $callback = null): \Closure
12511251
{
12521252
if ($this->outputDisabled) {
12531253
return fn ($type, $data): bool => null !== $callback && $callback($type, $data);

Tests/ProcessTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ public function testNotTerminableInputPipe()
15661566
$this->assertFalse($process->isRunning());
15671567
}
15681568

1569-
private function getProcess(string|array $commandline, string $cwd = null, array $env = null, mixed $input = null, ?int $timeout = 60): Process
1569+
private function getProcess(string|array $commandline, ?string $cwd = null, ?array $env = null, mixed $input = null, ?int $timeout = 60): Process
15701570
{
15711571
if (\is_string($commandline)) {
15721572
$process = Process::fromShellCommandline($commandline, $cwd, $env, $input, $timeout);
@@ -1579,7 +1579,7 @@ private function getProcess(string|array $commandline, string $cwd = null, array
15791579
return self::$process = $process;
15801580
}
15811581

1582-
private function getProcessForCode(string $code, string $cwd = null, array $env = null, $input = null, ?int $timeout = 60): Process
1582+
private function getProcessForCode(string $code, ?string $cwd = null, ?array $env = null, $input = null, ?int $timeout = 60): Process
15831583
{
15841584
return $this->getProcess([self::$phpBin, '-r', $code], $cwd, $env, $input, $timeout);
15851585
}

0 commit comments

Comments
 (0)