1
0
Fork 0

Merge pull request #5001 from curry684/issue-4999

Show -t incorrectly expanded self.version constraints. Fixes #4999
pull/4998/head^2
Jordi Boggiano 2016-03-04 15:39:36 +00:00
commit 3cea62b6ed
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 ($version) {
$constraint = $this->versionParser->parseConstraints($version);
}
$constraint = is_string($version) ? $this->versionParser->parseConstraints($version) : $version;
$policy = new DefaultPolicy();
$pool = new Pool('dev');