Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Jul 21, 2023
1 parent 8b90e16 commit 75150f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ protected function rename(string $binary, string $os): void
throw new RuntimeException("Unable to rename {$binary} without --install-dir");
}

$newName = array_reverse(explode(DIRECTORY_SEPARATOR, str_replace('chromedriver', 'chromedriver-'.$os, $binary), 2))[0];
$newName = strpos($binary, DIRECTORY_SEPARATOR) >= 0

Check failure on line 137 in src/UpdateCommand.php

View workflow job for this annotation

GitHub Actions / PHP8.1 on ubuntu-latest (locked)

Comparison operation ">=" between int<0, max>|false and 0 is always true.
? array_reverse(explode(DIRECTORY_SEPARATOR, str_replace('chromedriver', 'chromedriver-'.$os, $binary), 2))[0]
: str_replace('chromedriver', 'chromedriver-'.$os, $binary);

Check failure on line 139 in src/UpdateCommand.php

View workflow job for this annotation

GitHub Actions / PHP8.1 on ubuntu-latest (locked)

Else branch is unreachable because ternary operator condition is always true.

rename($this->directory.$binary, $this->directory.$newName);

Expand Down

0 comments on commit 75150f1

Please sign in to comment.