1
0
Fork 0
pull/3774/head
Jordi Boggiano 2015-02-24 14:22:54 +00:00
parent 3cff4a3bb9
commit 0b4a9235f4
12 changed files with 15 additions and 15 deletions

View File

@ -383,7 +383,7 @@ EOF;
} }
if (!$filesCode) { if (!$filesCode) {
return FALSE; return false;
} }
return <<<EOF return <<<EOF

View File

@ -33,7 +33,6 @@ use Composer\Json\JsonFile;
use Composer\Package\AliasPackage; use Composer\Package\AliasPackage;
use Composer\Package\CompletePackage; use Composer\Package\CompletePackage;
use Composer\Package\Link; use Composer\Package\Link;
use Composer\Package\LinkConstraint\EmptyConstraint;
use Composer\Package\LinkConstraint\VersionConstraint; use Composer\Package\LinkConstraint\VersionConstraint;
use Composer\Package\Locker; use Composer\Package\Locker;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
@ -1179,7 +1178,6 @@ class Installer
return $this; return $this;
} }
/** /**
* set whether to run autoloader or not * set whether to run autoloader or not
* *
@ -1193,7 +1191,6 @@ class Installer
return $this; return $this;
} }
/** /**
* set whether to run scripts or not * set whether to run scripts or not
* *

View File

@ -249,7 +249,7 @@ class ArrayLoader implements LoaderInterface
} }
// If using numeric aliases ensure the alias is a valid subversion // If using numeric aliases ensure the alias is a valid subversion
if(($sourcePrefix = $this->versionParser->parseNumericAliasPrefix($sourceBranch)) if (($sourcePrefix = $this->versionParser->parseNumericAliasPrefix($sourceBranch))
&& ($targetPrefix = $this->versionParser->parseNumericAliasPrefix($targetBranch)) && ($targetPrefix = $this->versionParser->parseNumericAliasPrefix($targetBranch))
&& (stripos($targetPrefix, $sourcePrefix) !== 0) && (stripos($targetPrefix, $sourcePrefix) !== 0)
) { ) {

View File

@ -279,13 +279,13 @@ class RootPackageLoader extends ArrayLoader
$length = PHP_INT_MAX; $length = PHP_INT_MAX;
$nonFeatureBranches = ''; $nonFeatureBranches = '';
if(!empty($config['non-feature-branches'])) { if (!empty($config['non-feature-branches'])) {
$nonFeatureBranches = implode('|', $config['non-feature-branches']); $nonFeatureBranches = implode('|', $config['non-feature-branches']);
} }
foreach ($branches as $candidate) { foreach ($branches as $candidate) {
// return directly, if branch is configured to be non-feature branch // return directly, if branch is configured to be non-feature branch
if($candidate === $branch && preg_match('{^(' . $nonFeatureBranches . ')$}', $candidate)) { if ($candidate === $branch && preg_match('{^(' . $nonFeatureBranches . ')$}', $candidate)) {
return $version; return $version;
} }

View File

@ -256,7 +256,7 @@ class ValidatingArrayLoader implements LoaderInterface
} }
// If using numeric aliases ensure the alias is a valid subversion // If using numeric aliases ensure the alias is a valid subversion
if(($sourcePrefix = $this->versionParser->parseNumericAliasPrefix($sourceBranch)) if (($sourcePrefix = $this->versionParser->parseNumericAliasPrefix($sourceBranch))
&& ($targetPrefix = $this->versionParser->parseNumericAliasPrefix($targetBranch)) && ($targetPrefix = $this->versionParser->parseNumericAliasPrefix($targetBranch))
&& (stripos($targetPrefix, $sourcePrefix) !== 0) && (stripos($targetPrefix, $sourcePrefix) !== 0)
) { ) {

View File

@ -242,7 +242,7 @@ class GitDriver extends VcsDriver
} }
$process = new ProcessExecutor($io); $process = new ProcessExecutor($io);
if($process->execute('git ls-remote --heads ' . ProcessExecutor::escape($url), $output) === 0) { if ($process->execute('git ls-remote --heads ' . ProcessExecutor::escape($url), $output) === 0) {
return true; return true;
} }

View File

@ -106,6 +106,7 @@ class AutoloadGeneratorTest extends TestCase
$ret = $ret(); $ret = $ret();
} }
} }
return $ret; return $ret;
})); }));

View File

@ -56,9 +56,10 @@ class ConsoleIOTest extends TestCase
$outputMock->expects($this->once()) $outputMock->expects($this->once())
->method('write') ->method('write')
->with( ->with(
$this->callback(function($messages){ $this->callback(function ($messages) {
$result = preg_match("[(.*)/(.*) First line]", $messages[0]) > 0; $result = preg_match("[(.*)/(.*) First line]", $messages[0]) > 0;
$result &= preg_match("[(.*)/(.*) Second line]", $messages[1]) > 0; $result &= preg_match("[(.*)/(.*) Second line]", $messages[1]) > 0;
return $result; return $result;
}), }),
$this->equalTo(false) $this->equalTo(false)

View File

@ -330,8 +330,7 @@ class InstallerTest extends TestCase
); );
$section = null; $section = null;
foreach ($tokens as $i => $token) foreach ($tokens as $i => $token) {
{
if (null === $section && empty($token)) { if (null === $section && empty($token)) {
continue; // skip leading blank continue; // skip leading blank
} }

View File

@ -14,7 +14,6 @@ namespace Composer\Test\Mock;
use Composer\Composer; use Composer\Composer;
use Composer\Config; use Composer\Config;
use Composer\Factory; use Composer\Factory;
use Composer\Repository;
use Composer\Repository\RepositoryManager; use Composer\Repository\RepositoryManager;
use Composer\Repository\WritableRepositoryInterface; use Composer\Repository\WritableRepositoryInterface;
use Composer\Installer; use Composer\Installer;

View File

@ -169,9 +169,10 @@ class RootPackageLoaderTest extends \PHPUnit_Framework_TestCase
$self = $this; $self = $this;
/* Can do away with this mock object when https://github.com/sebastianbergmann/phpunit-mock-objects/issues/81 is fixed */ /* Can do away with this mock object when https://github.com/sebastianbergmann/phpunit-mock-objects/issues/81 is fixed */
$processExecutor = new ProcessExecutorMock(function($command, &$output = null, $cwd = null) use ($self) { $processExecutor = new ProcessExecutorMock(function ($command, &$output = null, $cwd = null) use ($self) {
if (0 === strpos($command, 'git rev-list')) { if (0 === strpos($command, 'git rev-list')) {
$output = ""; $output = "";
return 0; return 0;
} }
@ -207,9 +208,10 @@ class RootPackageLoaderTest extends \PHPUnit_Framework_TestCase
$self = $this; $self = $this;
/* Can do away with this mock object when https://github.com/sebastianbergmann/phpunit-mock-objects/issues/81 is fixed */ /* Can do away with this mock object when https://github.com/sebastianbergmann/phpunit-mock-objects/issues/81 is fixed */
$processExecutor = new ProcessExecutorMock(function($command, &$output = null, $cwd = null) use ($self) { $processExecutor = new ProcessExecutorMock(function ($command, &$output = null, $cwd = null) use ($self) {
if (0 === strpos($command, 'git rev-list')) { if (0 === strpos($command, 'git rev-list')) {
$output = ""; $output = "";
return 0; return 0;
} }

View File

@ -166,6 +166,7 @@ class GitHubTest extends \PHPUnit_Framework_TestCase
return true; return true;
} }
} }
return false; return false;
}) })
) )