From 5b2c853fb4c44a20465676b6fa87f819f313fcd1 Mon Sep 17 00:00:00 2001 From: Peter Date: Wed, 20 Sep 2023 14:17:46 +0800 Subject: [PATCH] Shorten null coalescing operator --- src/BrowserFactory.php | 2 +- src/Communication/ResponseReader.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BrowserFactory.php b/src/BrowserFactory.php index f6564468..097904b2 100644 --- a/src/BrowserFactory.php +++ b/src/BrowserFactory.php @@ -65,7 +65,7 @@ public function __construct(string $chromeBinary = null) */ public function createBrowser(?array $options = null): ProcessAwareBrowser { - $options = $options ?? $this->options; + $options ??= $this->options; // create logger from options $logger = self::createLogger($options); diff --git a/src/Communication/ResponseReader.php b/src/Communication/ResponseReader.php index 73426868..85c6a085 100644 --- a/src/Communication/ResponseReader.php +++ b/src/Communication/ResponseReader.php @@ -109,7 +109,7 @@ public function waitForResponse(int $timeout = null): Response return $this->getResponse(); } - $timeout = $timeout ?? $this->connection->getSendSyncDefaultTimeout(); + $timeout ??= $this->connection->getSendSyncDefaultTimeout(); return Utils::tryWithTimeout($timeout * 1000, $this->waitForResponseGenerator()); }