function DownloadManager::prepare
Prepares an operation execution
@phpstan-return PromiseInterface<void|null>
Parameters
string $type one of install/update/uninstall:
PackageInterface $package package instance:
string $targetDir target dir:
PackageInterface|null $prevPackage previous package instance in case of updates:
File
-
vendor/
composer/ composer/ src/ Composer/ Downloader/ DownloadManager.php, line 247
Class
- DownloadManager
- Downloaders manager.
Namespace
Composer\DownloaderCode
public function prepare(string $type, PackageInterface $package, string $targetDir, ?PackageInterface $prevPackage = null) : PromiseInterface {
$targetDir = $this->normalizeTargetDir($targetDir);
$downloader = $this->getDownloaderForPackage($package);
if ($downloader) {
return $downloader->prepare($type, $package, $targetDir, $prevPackage);
}
return \React\Promise\resolve(null);
}