function ComposerRepository::findPackages
@inheritDoc
Overrides ArrayRepository::findPackages
File
-
vendor/
composer/ composer/ src/ Composer/ Repository/ ComposerRepository.php, line 250
Class
- ComposerRepository
- @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\RepositoryCode
public function findPackages(string $name, $constraint = null) {
// this call initializes loadRootServerFile which is needed for the rest below to work
$hasProviders = $this->hasProviders();
$name = strtolower($name);
if (null !== $constraint && !$constraint instanceof ConstraintInterface) {
$constraint = $this->versionParser
->parseConstraints($constraint);
}
if ($this->lazyProvidersUrl) {
if ($this->hasPartialPackages() && isset($this->partialPackagesByName[$name])) {
return $this->filterPackages($this->whatProvides($name), $constraint);
}
if ($this->hasAvailablePackageList && !$this->lazyProvidersRepoContains($name)) {
return [];
}
$result = $this->loadAsyncPackages([
$name => $constraint,
]);
return $result['packages'];
}
if ($hasProviders) {
foreach ($this->getProviderNames() as $providerName) {
if ($name === $providerName) {
return $this->filterPackages($this->whatProvides($providerName), $constraint);
}
}
return [];
}
return parent::findPackages($name, $constraint);
}