Skip to content

Commit

Permalink
Make implicit nullable types explicit (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Mar 21, 2024
1 parent 04b4517 commit dd01aa8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"homepage": "https://github.com/amphp/process",
"description": "Asynchronous process manager.",
"require": {
"php": ">=7",
"php": ">=7.1",
"amphp/amp": "^2",
"amphp/byte-stream": "^1.4"
},
Expand Down Expand Up @@ -40,7 +40,7 @@
},
"config": {
"platform": {
"php": "7.0.33"
"php": "7.1.3"
}
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion lib/Internal/Posix/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static function onProcessStartExtraDataPipeReadable($watcher, $stream, $d
}

/** @inheritdoc */
public function start(string $command, string $cwd = null, array $env = [], array $options = []): ProcessHandle
public function start(string $command, ?string $cwd = null, array $env = [], array $options = []): ProcessHandle
{
$command = \sprintf(
'{ (%s) <&3 3<&- 3>/dev/null & } 3<&0; trap "" INT TERM QUIT HUP;' .
Expand Down
2 changes: 1 addition & 1 deletion lib/Internal/ProcessRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface ProcessRunner
*
* @throws ProcessException If starting the process fails.
*/
public function start(string $command, string $cwd = null, array $env = [], array $options = []): ProcessHandle;
public function start(string $command, ?string $cwd = null, array $env = [], array $options = []): ProcessHandle;

/**
* Wait for the child process to end.
Expand Down
2 changes: 1 addition & 1 deletion lib/Internal/Windows/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct()
}

/** @inheritdoc */
public function start(string $command, string $cwd = null, array $env = [], array $options = []): ProcessHandle
public function start(string $command, ?string $cwd = null, array $env = [], array $options = []): ProcessHandle
{
if (\strpos($command, "\0") !== false) {
throw new ProcessException("Can't execute commands that contain null bytes.");
Expand Down
2 changes: 1 addition & 1 deletion lib/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final class Process
*
* @throws \Error If the arguments are invalid.
*/
public function __construct($command, string $cwd = null, array $env = [], array $options = [])
public function __construct($command, ?string $cwd = null, array $env = [], array $options = [])
{
$command = \is_array($command)
? \implode(" ", \array_map(__NAMESPACE__ . "\\escapeArguments", $command))
Expand Down

0 comments on commit dd01aa8

Please sign in to comment.