Skip to content

Commit

Permalink
Fix type error when PATH env is not set, fixes #10662
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Mar 29, 2022
1 parent 6bd75d5 commit 0708eb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Composer/EventDispatcher/EventDispatcher.php
Expand Up @@ -576,7 +576,7 @@ private function ensureBinDirIsInPath(): void
$binDir = $this->composer->getConfig()->get('bin-dir');
if (is_dir($binDir)) {
$binDir = realpath($binDir);
$pathValue = Platform::getEnv($pathEnv);
$pathValue = (string) Platform::getEnv($pathEnv);
if (!Preg::isMatch('{(^|'.PATH_SEPARATOR.')'.preg_quote($binDir).'($|'.PATH_SEPARATOR.')}', $pathValue)) {
Platform::putEnv($pathEnv, $binDir.PATH_SEPARATOR.$pathValue);
}
Expand Down

0 comments on commit 0708eb4

Please sign in to comment.