From 65243ca3922d0872fd3d24d882cba9a1a47058c0 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 8 Jun 2015 18:45:03 +0200 Subject: [PATCH] Move methods for PR readability and fix phpdoc --- .../Repository/ComposerRepository.php | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index 23867ddef..b17e61515 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -100,6 +100,14 @@ class ComposerRepository extends ArrayRepository return $this->rootAliases; } + /** + * Load all packages with given names and dependencies + * + * @param array $packageNames + * @param callable|null $acceptableCallback Callback to filter packages + * + * @return array The loaded package objects + */ public function loadRecursively(array $packageNames, $acceptableCallback) { $workQueue = new \SplQueue; @@ -258,11 +266,29 @@ class ComposerRepository extends ArrayRepository return $providers; } + protected function configurePackageTransportOptions(PackageInterface $package) + { + foreach ($package->getDistUrls() as $url) { + if (strpos($url, $this->baseUrl) === 0) { + $package->setTransportOptions($this->options); + + return; + } + } + } + + public function hasProviders() + { + $this->loadRootServerFile(); + + return $this->hasProviders; + } + /** * Loads package data for a given package name or provider name * * @param string $name - * @param callable $acceptableCallback A callback to check if a package should be loaded + * @param callable|null $acceptableCallback A callback to check if a package should be loaded * @param bool $exactMatch Whether packages only providing the name should be ignored * * @return array All packages that were loaded @@ -337,25 +363,6 @@ class ComposerRepository extends ArrayRepository return $loadedPackages; } - - protected function configurePackageTransportOptions(PackageInterface $package) - { - foreach ($package->getDistUrls() as $url) { - if (strpos($url, $this->baseUrl) === 0) { - $package->setTransportOptions($this->options); - - return; - } - } - } - - public function hasProviders() - { - $this->loadRootServerFile(); - - return $this->hasProviders; - } - /** * {@inheritDoc} */