CS fixes
parent
67a1924173
commit
966a982738
|
@ -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
|
||||||
|
|
|
@ -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); },
|
||||||
|
|
|
@ -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'] &&
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -56,9 +56,9 @@ class RootPackageLoader extends ArrayLoader
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $config package data
|
* @param array $config package data
|
||||||
* @param string $class FQCN to be instantiated
|
* @param string $class FQCN to be instantiated
|
||||||
* @param string $cwd cwd of the root package to be used to guess the version if it is not provided
|
* @param string $cwd cwd of the root package to be used to guess the version if it is not provided
|
||||||
* @return PackageInterface
|
* @return PackageInterface
|
||||||
*/
|
*/
|
||||||
public function load(array $config, $class = 'Composer\Package\RootPackage', $cwd = null)
|
public function load(array $config, $class = 'Composer\Package\RootPackage', $cwd = null)
|
||||||
|
|
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -508,8 +508,8 @@ class Filesystem
|
||||||
/**
|
/**
|
||||||
* Creates a relative symlink from $link to $target
|
* Creates a relative symlink from $link to $target
|
||||||
*
|
*
|
||||||
* @param string $target The path of the binary file to be symlinked
|
* @param string $target The path of the binary file to be symlinked
|
||||||
* @param string $link The path where the symlink should be created
|
* @param string $link The path where the symlink should be created
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function relativeSymlink($target, $link)
|
public function relativeSymlink($target, $link)
|
||||||
|
|
|
@ -145,7 +145,7 @@ class EventDispatcherTest extends TestCase
|
||||||
public function testDispatcherCanExecuteComposerScriptGroups()
|
public function testDispatcherCanExecuteComposerScriptGroups()
|
||||||
{
|
{
|
||||||
$process = $this->getMock('Composer\Util\ProcessExecutor');
|
$process = $this->getMock('Composer\Util\ProcessExecutor');
|
||||||
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
||||||
->setConstructorArgs(array(
|
->setConstructorArgs(array(
|
||||||
$composer = $this->getMock('Composer\Composer'),
|
$composer = $this->getMock('Composer\Composer'),
|
||||||
$io = $this->getMock('Composer\IO\IOInterface'),
|
$io = $this->getMock('Composer\IO\IOInterface'),
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue