From c7c1702324b40272eaca6519c573555a03faf3d7 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Wed, 24 Jul 2024 23:46:41 +0800 Subject: [PATCH] [8.x] Fixes installing ChromeDriver 127 and above. (#1110) fixes #1109 Signed-off-by: Mior Muhammad Zaki --- src/Console/ChromeDriverCommand.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Console/ChromeDriverCommand.php b/src/Console/ChromeDriverCommand.php index 45e642008..d8190f769 100644 --- a/src/Console/ChromeDriverCommand.php +++ b/src/Console/ChromeDriverCommand.php @@ -225,7 +225,13 @@ protected function extract($version, $archive) $zip->extractTo($this->directory); - $binary = $zip->getNameIndex(version_compare($version, '115.0', '<') ? 0 : 1); + $index = match (true) { + version_compare($version, '115.0', '<') => 0, + version_compare($version, '127.0', '<') => 1, + default => 2, + }; + + $binary = $zip->getNameIndex($index); $zip->close();