From a79dc87100be857db2c4bbfd5369585a6d1e658c Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Tue, 13 Feb 2024 14:38:21 -0600 Subject: [PATCH] Use correct guard property --- src/Process.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Process.php b/src/Process.php index 7838b12..454c9bf 100644 --- a/src/Process.php +++ b/src/Process.php @@ -97,8 +97,11 @@ public static function start( private static function getRunner(): ProcessRunner { /** @psalm-suppress RedundantPropertyInitializationCheck */ - if (!isset(self::$driverRunner)) { - self::$driverRunner = new \WeakMap(); + self::$driverRunner ??= new \WeakMap(); + + /** @psalm-suppress RedundantPropertyInitializationCheck */ + if (!isset(self::$procHolder)) { + self::$procHolder = new \WeakMap(); \register_shutdown_function(static function (): void { /** @var ProcHolder $procHolder */ @@ -108,9 +111,6 @@ private static function getRunner(): ProcessRunner }); } - /** @psalm-suppress RedundantPropertyInitializationCheck */ - self::$procHolder ??= new \WeakMap(); - /** @psalm-suppress RedundantPropertyInitializationCheck */ self::$streamHolder ??= new \WeakMap();