Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make nullable parameters explicity nullable for PHP 8.4 #111

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Process extends EventEmitter
* @param null|array $fds File descriptors to allocate for this process (or null = default STDIO streams)
* @throws \LogicException On windows or when proc_open() is not installed
*/
public function __construct($cmd, $cwd = null, array $env = null, array $fds = null)
public function __construct($cmd, $cwd = null, ?array $env = null, ?array $fds = null)
{
if (!\function_exists('proc_open')) {
throw new \LogicException('The Process class relies on proc_open(), which is not available on your PHP installation.');
Expand Down Expand Up @@ -164,7 +164,7 @@ public function __construct($cmd, $cwd = null, array $env = null, array $fds = n
* @param float $interval Interval to periodically monitor process state (seconds)
* @throws \RuntimeException If the process is already running or fails to start
*/
public function start(LoopInterface $loop = null, $interval = 0.1)
public function start(?LoopInterface $loop = null, $interval = 0.1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update this method the same way this method has been updated in another package? https://github.com/reactphp/socket/pull/318/files#diff-2c0b16424077d1ecafdbbca23aa3f137bc007241b00fe55dd536434c147326ca This way we can ensure it runs on all PHP versions in rage

{
if ($this->isRunning()) {
throw new \RuntimeException('Process is already running');
Expand Down
Loading