1
0
Fork 0

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

pull/10669/head
Jordi Boggiano 2022-03-29 14:07:04 +02:00
parent 6bd75d5738
commit 0708eb45e5
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 1 additions and 1 deletions

View File

@ -576,7 +576,7 @@ class EventDispatcher
$binDir = $this->composer->getConfig()->get('bin-dir'); $binDir = $this->composer->getConfig()->get('bin-dir');
if (is_dir($binDir)) { if (is_dir($binDir)) {
$binDir = realpath($binDir); $binDir = realpath($binDir);
$pathValue = Platform::getEnv($pathEnv); $pathValue = (string) Platform::getEnv($pathEnv);
if (!Preg::isMatch('{(^|'.PATH_SEPARATOR.')'.preg_quote($binDir).'($|'.PATH_SEPARATOR.')}', $pathValue)) { if (!Preg::isMatch('{(^|'.PATH_SEPARATOR.')'.preg_quote($binDir).'($|'.PATH_SEPARATOR.')}', $pathValue)) {
Platform::putEnv($pathEnv, $binDir.PATH_SEPARATOR.$pathValue); Platform::putEnv($pathEnv, $binDir.PATH_SEPARATOR.$pathValue);
} }