1
0
Fork 0

Corrected parameter handling.

pull/5001/head
Niels Keurentjes 2016-03-04 09:26:11 +01:00
parent a3b2628748
commit 1017ab817f
1 changed files with 8 additions and 9 deletions

View File

@ -19,6 +19,7 @@ use Composer\Package\Version\VersionParser;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
use Composer\Package\PackageInterface;
use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Util\Platform;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Input\InputInterface;
@ -40,6 +41,7 @@ use Composer\Spdx\SpdxLicenses;
*/
class ShowCommand extends BaseCommand
{
/** @var VersionParser */
protected $versionParser;
protected $colors;
@ -289,17 +291,14 @@ EOT
* @param RepositoryInterface $installedRepo
* @param RepositoryInterface $repos
* @param string $name
* @param string $version
* @param ConstraintInterface|string $version
* @throws \InvalidArgumentException
* @return array array(CompletePackageInterface, array of versions)
*/
protected function getPackage(RepositoryInterface $installedRepo, RepositoryInterface $repos, $name, $version = null)
{
$name = strtolower($name);
$constraint = null;
if (is_string($version)) {
$constraint = $this->versionParser->parseConstraints($version);
}
$constraint = is_string($version) ? $this->versionParser->parseConstraints($version) : $version;
$policy = new DefaultPolicy();
$pool = new Pool('dev');