function Transaction::moveUninstallsToFront
Removals of packages should be executed before installations in case two packages resolve to the same path (due to custom installers)
Parameters
OperationInterface[] $operations:
Return value
OperationInterface[] reordered operation list
1 call to Transaction::moveUninstallsToFront()
- Transaction::calculateOperations in vendor/
composer/ composer/ src/ Composer/ DependencyResolver/ Transaction.php
File
-
vendor/
composer/ composer/ src/ Composer/ DependencyResolver/ Transaction.php, line 346
Class
- Transaction
- @author Nils Adermann <naderman@naderman.de> @internal
Namespace
Composer\DependencyResolverCode
private function moveUninstallsToFront(array $operations) : array {
$uninstOps = [];
foreach ($operations as $idx => $op) {
if ($op instanceof Operation\UninstallOperation || $op instanceof Operation\MarkAliasUninstalledOperation) {
$uninstOps[] = $op;
unset($operations[$idx]);
}
}
return array_merge($uninstOps, $operations);
}