Fix type error when PATH env is not set, fixes #10662

main
Jordi Boggiano 2 years ago
parent 6bd75d5738
commit 0708eb45e5
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -576,7 +576,7 @@ class EventDispatcher
$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);
}

Loading…
Cancel
Save