Skip to content

Commit

Permalink
Fix type error when PATH env is not set, fixes composer#10662
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek authored and emahorvat52 committed Jan 18, 2023
1 parent e1a4dc9 commit d1f589e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Composer/EventDispatcher/EventDispatcher.php
Expand Up @@ -583,7 +583,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 d1f589e

Please sign in to comment.