Fix type error when upgrading composer
parent
1ff942bb44
commit
b5aad9ec0d
|
@ -163,11 +163,15 @@ class FilesystemRepository extends WritableArrayRepository
|
||||||
|
|
||||||
$this->filesystem->filePutContentsIfModified($repoDir.'/installed.php', '<?php return ' . $this->dumpToPhpCode($versions) . ';'."\n");
|
$this->filesystem->filePutContentsIfModified($repoDir.'/installed.php', '<?php return ' . $this->dumpToPhpCode($versions) . ';'."\n");
|
||||||
$installedVersionsClass = file_get_contents(__DIR__.'/../InstalledVersions.php');
|
$installedVersionsClass = file_get_contents(__DIR__.'/../InstalledVersions.php');
|
||||||
|
|
||||||
|
// this normally should not happen but during upgrades of Composer when it is installed in the project it is a possibility
|
||||||
|
if ($installedVersionsClass !== false) {
|
||||||
$this->filesystem->filePutContentsIfModified($repoDir.'/InstalledVersions.php', $installedVersionsClass);
|
$this->filesystem->filePutContentsIfModified($repoDir.'/InstalledVersions.php', $installedVersionsClass);
|
||||||
|
|
||||||
\Composer\InstalledVersions::reload($versions);
|
\Composer\InstalledVersions::reload($versions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array<mixed> $array
|
* @param array<mixed> $array
|
||||||
|
|
Loading…
Reference in New Issue