1
0
Fork 0

Merge pull request #7364 from robbieaverill/pulls/1.6/phpdoc-fixes

FIX Update PHPDocs to indicate more specific return types
pull/7382/head
Jordi Boggiano 2018-05-31 19:54:58 +02:00 committed by GitHub
commit ccb4acaf3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -54,6 +54,7 @@ class RepositoryManager
public function findPackage($name, $constraint) public function findPackage($name, $constraint)
{ {
foreach ($this->repositories as $repository) { foreach ($this->repositories as $repository) {
/** @var RepositoryInterface $repository */
if ($package = $repository->findPackage($name, $constraint)) { if ($package = $repository->findPackage($name, $constraint)) {
return $package; return $package;
} }
@ -68,13 +69,13 @@ class RepositoryManager
* @param string $name package name * @param string $name package name
* @param string|\Composer\Semver\Constraint\ConstraintInterface $constraint package version or version constraint to match against * @param string|\Composer\Semver\Constraint\ConstraintInterface $constraint package version or version constraint to match against
* *
* @return array * @return PackageInterface[]
*/ */
public function findPackages($name, $constraint) public function findPackages($name, $constraint)
{ {
$packages = array(); $packages = array();
foreach ($this->repositories as $repository) { foreach ($this->getRepositories() as $repository) {
$packages = array_merge($packages, $repository->findPackages($name, $constraint)); $packages = array_merge($packages, $repository->findPackages($name, $constraint));
} }
@ -147,7 +148,7 @@ class RepositoryManager
/** /**
* Returns all repositories, except local one. * Returns all repositories, except local one.
* *
* @return array * @return RepositoryInterface[]
*/ */
public function getRepositories() public function getRepositories()
{ {