function VcsRepository::preProcess
Parameters
array{name?: string, dist?: array{type: string, url: string, reference: string, shasum: string}, source?: array{type: string, url: string, reference: string}} $data:
Return value
array{name: string|null, dist: array{type: string, url: string, reference: string, shasum: string}|null, source: array{type: string, url: string, reference: string}}
1 call to VcsRepository::preProcess()
- VcsRepository::initialize in vendor/
composer/ composer/ src/ Composer/ Repository/ VcsRepository.php - Initializes the packages array. Mostly meant as an extension point.
File
-
vendor/
composer/ composer/ src/ Composer/ Repository/ VcsRepository.php, line 431
Class
- VcsRepository
- @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\RepositoryCode
protected function preProcess(VcsDriverInterface $driver, array $data, string $identifier) : array {
// keep the name of the main identifier for all packages
// this ensures that a package can be renamed in one place and that all old tags
// will still be installable using that new name without requiring re-tagging
$dataPackageName = $data['name'] ?? null;
$data['name'] = $this->packageName ?: $dataPackageName;
if (!isset($data['dist'])) {
$data['dist'] = $driver->getDist($identifier);
}
if (!isset($data['source'])) {
$data['source'] = $driver->getSource($identifier);
}
return $data;
}