function Installer::requirePackagesForUpdate
2 calls to Installer::requirePackagesForUpdate()
- Installer::doUpdate in vendor/
composer/ composer/ src/ Composer/ Installer.php - @phpstan-return self::ERROR_*
- Installer::extractDevPackages in vendor/
composer/ composer/ src/ Composer/ Installer.php - Run the solver a second time on top of the existing update result with only the current result set in the pool and see what packages would get removed if we only had the non-dev packages in the solver request
File
-
vendor/
composer/ composer/ src/ Composer/ Installer.php, line 1007
Class
- Installer
- @author Jordi Boggiano <j.boggiano@seld.be> @author Beau Simensen <beau@dflydev.com> @author Konstantin Kudryashov <ever.zet@gmail.com> @author Nils Adermann <naderman@naderman.de>
Namespace
ComposerCode
private function requirePackagesForUpdate(Request $request, ?LockArrayRepository $lockedRepository = null, bool $includeDevRequires = true) : void {
// if we're updating mirrors we want to keep exactly the same versions installed which are in the lock file, but we want current remote metadata
if ($this->updateMirrors) {
$excludedPackages = [];
if (!$includeDevRequires) {
$excludedPackages = array_flip($this->locker
->getDevPackageNames());
}
foreach ($lockedRepository->getPackages() as $lockedPackage) {
// exclude alias packages here as for root aliases, both alias and aliased are
// present in the lock repo and we only want to require the aliased version
if (!$lockedPackage instanceof AliasPackage && !isset($excludedPackages[$lockedPackage->getName()])) {
$request->requireName($lockedPackage->getName(), new Constraint('==', $lockedPackage->getVersion()));
}
}
}
else {
$links = $this->package
->getRequires();
if ($includeDevRequires) {
$links = array_merge($links, $this->package
->getDevRequires());
}
foreach ($links as $link) {
$request->requireName($link->getTarget(), $link->getConstraint());
}
}
}