1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 17:12:51 +00:00
This commit is contained in:
Jordi Boggiano 2017-12-18 16:02:48 +01:00
parent f31b820b09
commit c8aea719b1
19 changed files with 56 additions and 43 deletions

View file

@ -1,11 +1,20 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Command;
use Composer\Package\Link;
use Composer\Package\PackageInterface;
use Composer\Semver\Constraint\Constraint;
use Composer\Semver\Constraint\MultiConstraint;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
@ -115,17 +124,17 @@ EOT
protected function printTable(OutputInterface $output, $results)
{
$table = array();
$rows = array();
$rows = array();
foreach ($results as $result) {
/**
* @var Link|null $link
*/
list($platformPackage, $version, $link, $status) = $result;
$rows[] = array(
$rows[] = array(
$platformPackage,
$version,
$link ? sprintf('%s %s %s (%s)', $link->getSource(), $link->getDescription(), $link->getTarget(), $link->getPrettyConstraint()) : '',
$status
$status,
);
}
$table = array_merge($rows, $table);

View file

@ -191,7 +191,7 @@ EOT
$name = basename($cwd);
$name = preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\1\\3-\\2\\4', $name);
$name = strtolower($name);
if ( !empty($_SERVER['COMPOSER_DEFAULT_VENDOR']) ) {
if (!empty($_SERVER['COMPOSER_DEFAULT_VENDOR'])) {
$name = $_SERVER['COMPOSER_DEFAULT_VENDOR'] . '/' . $name;
} elseif (isset($git['github.user'])) {
$name = $git['github.user'] . '/' . $name;
@ -242,15 +242,15 @@ EOT
$input->setOption('description', $description);
if (null === $author = $input->getOption('author')) {
if ( !empty($_SERVER['COMPOSER_DEFAULT_AUTHOR']) ) {
if (!empty($_SERVER['COMPOSER_DEFAULT_AUTHOR'])) {
$author_name = $_SERVER['COMPOSER_DEFAULT_AUTHOR'];
} elseif ( isset($git['user.name']) ) {
} elseif (isset($git['user.name'])) {
$author_name = $git['user.name'];
}
if ( !empty($_SERVER['COMPOSER_DEFAULT_EMAIL']) ) {
if (!empty($_SERVER['COMPOSER_DEFAULT_EMAIL'])) {
$author_email = $_SERVER['COMPOSER_DEFAULT_EMAIL'];
} elseif ( isset($git['user.email']) ) {
} elseif (isset($git['user.email'])) {
$author_email = $git['user.email'];
}
@ -306,7 +306,7 @@ EOT
$input->setOption('type', $type);
if (null === $license = $input->getOption('license')) {
if ( !empty($_SERVER['COMPOSER_DEFAULT_LICENSE']) ) {
if (!empty($_SERVER['COMPOSER_DEFAULT_LICENSE'])) {
$license = $_SERVER['COMPOSER_DEFAULT_LICENSE'];
}
}
@ -423,7 +423,7 @@ EOT
$abandoned = sprintf('<warning>Abandoned. %s.</warning>', $replacement);
}
$choices[] = sprintf(' <info>%5s</info> %s %s',"[$position]", $foundPackage['name'], $abandoned);
$choices[] = sprintf(' <info>%5s</info> %s %s', "[$position]", $foundPackage['name'], $abandoned);
if ($foundPackage['name'] === $package) {
$exactMatch = true;
break;