1
0
Fork 0
pull/4623/head
Jordi Boggiano 2015-11-21 19:28:10 +00:00
parent 67a1924173
commit 966a982738
11 changed files with 14 additions and 14 deletions

View File

@ -388,7 +388,7 @@ EOF;
'psr-4' => $psr4, 'psr-4' => $psr4,
'classmap' => $classmap, 'classmap' => $classmap,
'files' => $files, 'files' => $files,
'exclude-from-classmap' => $exclude 'exclude-from-classmap' => $exclude,
); );
} }
@ -668,7 +668,6 @@ function composerRequire$suffix(\$fileIdentifier, \$file)
} }
FOOTER; FOOTER;
} }
return $file . <<<FOOTER return $file . <<<FOOTER

View File

@ -309,7 +309,7 @@ EOT
), ),
'bin-compat' => array( 'bin-compat' => array(
function ($val) { return in_array($val, array('auto', 'full')); }, function ($val) { return in_array($val, array('auto', 'full')); },
function ($val) { return $val; } function ($val) { return $val; },
), ),
'discard-changes' => array( 'discard-changes' => array(
function ($val) { return in_array($val, array('stash', 'true', 'false', '1', '0'), true); }, function ($val) { return in_array($val, array('stash', 'true', 'false', '1', '0'), true); },

View File

@ -70,7 +70,7 @@ class Application extends BaseApplication
if (!$shutdownRegistered) { if (!$shutdownRegistered) {
$shutdownRegistered = true; $shutdownRegistered = true;
register_shutdown_function(function() { register_shutdown_function(function () {
$lastError = error_get_last(); $lastError = error_get_last();
if ($lastError && $lastError['message'] && if ($lastError && $lastError['message'] &&

View File

@ -32,12 +32,12 @@ class XzDownloader extends ArchiveDownloader
public function __construct(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, Cache $cache = null, ProcessExecutor $process = null) public function __construct(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, Cache $cache = null, ProcessExecutor $process = null)
{ {
$this->process = $process ?: new ProcessExecutor($io); $this->process = $process ?: new ProcessExecutor($io);
parent::__construct($io, $config, $eventDispatcher, $cache); parent::__construct($io, $config, $eventDispatcher, $cache);
} }
protected function extract($file, $path) protected function extract($file, $path)
{ {
$command = 'tar -xJf ' . ProcessExecutor::escape($file) . ' -C ' . ProcessExecutor::escape($path); $command = 'tar -xJf ' . ProcessExecutor::escape($file) . ' -C ' . ProcessExecutor::escape($path);
if (0 === $this->process->execute($command, $ignoredOutput)) { if (0 === $this->process->execute($command, $ignoredOutput)) {
@ -45,8 +45,8 @@ class XzDownloader extends ArchiveDownloader
} }
$processError = 'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput(); $processError = 'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput();
throw new \RuntimeException($processError);
throw new \RuntimeException($processError);
} }
/** /**

View File

@ -18,7 +18,6 @@ use Composer\Repository\InstalledRepositoryInterface;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Util\ProcessExecutor; use Composer\Util\ProcessExecutor;
use Composer\Util\Symlink;
/** /**
* Package installation manager. * Package installation manager.

View File

@ -57,6 +57,7 @@ class VersionSelector
$phpConstraint = new Constraint('==', $this->getParser()->normalize($targetPhpVersion)); $phpConstraint = new Constraint('==', $this->getParser()->normalize($targetPhpVersion));
$candidates = array_filter($candidates, function ($pkg) use ($phpConstraint) { $candidates = array_filter($candidates, function ($pkg) use ($phpConstraint) {
$reqs = $pkg->getRequires(); $reqs = $pkg->getRequires();
return !isset($reqs['php']) || $reqs['php']->getConstraint()->matches($phpConstraint); return !isset($reqs['php']) || $reqs['php']->getConstraint()->matches($phpConstraint);
}); });
} }

View File

@ -19,7 +19,6 @@ use Prophecy\Argument;
class RootAliasPackageTest extends TestCase class RootAliasPackageTest extends TestCase
{ {
public function testUpdateRequires() public function testUpdateRequires()
{ {
$root = $this->getMockRootPackageInterface(); $root = $this->getMockRootPackageInterface();
@ -89,6 +88,7 @@ class RootAliasPackageTest extends TestCase
$root->getConflicts()->willReturn(array())->shouldBeCalled(); $root->getConflicts()->willReturn(array())->shouldBeCalled();
$root->getProvides()->willReturn(array())->shouldBeCalled(); $root->getProvides()->willReturn(array())->shouldBeCalled();
$root->getReplaces()->willReturn(array())->shouldBeCalled(); $root->getReplaces()->willReturn(array())->shouldBeCalled();
return $root; return $root;
} }
} }

View File

@ -213,6 +213,7 @@ class VersionSelectorTest extends \PHPUnit_Framework_TestCase
private function createPackage($version) private function createPackage($version)
{ {
$parser = new VersionParser(); $parser = new VersionParser();
return new Package('foo', $parser->normalize($version), $version); return new Package('foo', $parser->normalize($version), $version);
} }