diff --git a/composer.json b/composer.json index a20c501..06e6a2a 100644 --- a/composer.json +++ b/composer.json @@ -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" }, @@ -40,7 +40,7 @@ }, "config": { "platform": { - "php": "7.0.33" + "php": "7.1.3" } }, "scripts": { diff --git a/lib/Internal/Posix/Runner.php b/lib/Internal/Posix/Runner.php index dffbc4d..d073b79 100644 --- a/lib/Internal/Posix/Runner.php +++ b/lib/Internal/Posix/Runner.php @@ -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;' . diff --git a/lib/Internal/ProcessRunner.php b/lib/Internal/ProcessRunner.php index 3adf0f2..6c12821 100644 --- a/lib/Internal/ProcessRunner.php +++ b/lib/Internal/ProcessRunner.php @@ -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. diff --git a/lib/Internal/Windows/Runner.php b/lib/Internal/Windows/Runner.php index d4bbd86..6bca96c 100644 --- a/lib/Internal/Windows/Runner.php +++ b/lib/Internal/Windows/Runner.php @@ -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."); diff --git a/lib/Process.php b/lib/Process.php index 2826b80..5c7c40c 100644 --- a/lib/Process.php +++ b/lib/Process.php @@ -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))