Several small code improvements
parent
80d71ccb3f
commit
2223b93efd
|
@ -147,11 +147,7 @@ class Pool implements \Countable
|
||||||
$candidateVersion = $candidate->getVersion();
|
$candidateVersion = $candidate->getVersion();
|
||||||
|
|
||||||
if ($candidateName === $name) {
|
if ($candidateName === $name) {
|
||||||
if ($constraint === null || CompilingMatcher::match($constraint, Constraint::OP_EQ, $candidateVersion)) {
|
return $constraint === null || CompilingMatcher::match($constraint, Constraint::OP_EQ, $candidateVersion);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$provides = $candidate->getProvides();
|
$provides = $candidate->getProvides();
|
||||||
|
|
|
@ -996,7 +996,7 @@ class Installer
|
||||||
if (!$this->optimizeAutoloader) {
|
if (!$this->optimizeAutoloader) {
|
||||||
// Force classMapAuthoritative off when not optimizing the
|
// Force classMapAuthoritative off when not optimizing the
|
||||||
// autoloader
|
// autoloader
|
||||||
$this->setClassMapAuthoritative();
|
$this->setClassMapAuthoritative(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|
|
@ -35,7 +35,7 @@ class HhvmDetector
|
||||||
public function getVersion()
|
public function getVersion()
|
||||||
{
|
{
|
||||||
if (null !== self::$hhvmVersion) {
|
if (null !== self::$hhvmVersion) {
|
||||||
return self::$hhvmVersion;
|
return self::$hhvmVersion ?: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
self::$hhvmVersion = defined('HHVM_VERSION') ? HHVM_VERSION : null;
|
self::$hhvmVersion = defined('HHVM_VERSION') ? HHVM_VERSION : null;
|
||||||
|
|
|
@ -20,8 +20,6 @@ use Composer\Util\Http\Response;
|
||||||
|
|
||||||
abstract class BitbucketDriver extends VcsDriver
|
abstract class BitbucketDriver extends VcsDriver
|
||||||
{
|
{
|
||||||
/** @var Cache */
|
|
||||||
protected $cache;
|
|
||||||
protected $owner;
|
protected $owner;
|
||||||
protected $repository;
|
protected $repository;
|
||||||
protected $hasIssues;
|
protected $hasIssues;
|
||||||
|
|
|
@ -25,7 +25,6 @@ use Composer\Config;
|
||||||
*/
|
*/
|
||||||
class GitDriver extends VcsDriver
|
class GitDriver extends VcsDriver
|
||||||
{
|
{
|
||||||
protected $cache;
|
|
||||||
protected $tags;
|
protected $tags;
|
||||||
protected $branches;
|
protected $branches;
|
||||||
protected $rootIdentifier;
|
protected $rootIdentifier;
|
||||||
|
|
|
@ -25,7 +25,6 @@ use Composer\Util\Http\Response;
|
||||||
*/
|
*/
|
||||||
class GitHubDriver extends VcsDriver
|
class GitHubDriver extends VcsDriver
|
||||||
{
|
{
|
||||||
protected $cache;
|
|
||||||
protected $owner;
|
protected $owner;
|
||||||
protected $repository;
|
protected $repository;
|
||||||
protected $tags;
|
protected $tags;
|
||||||
|
|
|
@ -28,10 +28,6 @@ use Composer\Downloader\TransportException;
|
||||||
*/
|
*/
|
||||||
class SvnDriver extends VcsDriver
|
class SvnDriver extends VcsDriver
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @var Cache
|
|
||||||
*/
|
|
||||||
protected $cache;
|
|
||||||
protected $baseUrl;
|
protected $baseUrl;
|
||||||
protected $tags;
|
protected $tags;
|
||||||
protected $branches;
|
protected $branches;
|
||||||
|
|
|
@ -79,6 +79,7 @@ class Git
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$messages[] = '- ' . $protoUrl . "\n" . preg_replace('#^#m', ' ', $this->process->getErrorOutput());
|
$messages[] = '- ' . $protoUrl . "\n" . preg_replace('#^#m', ' ', $this->process->getErrorOutput());
|
||||||
|
|
||||||
if ($initialClone && isset($origCwd)) {
|
if ($initialClone && isset($origCwd)) {
|
||||||
$this->filesystem->removeDirectory($origCwd);
|
$this->filesystem->removeDirectory($origCwd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,7 +207,7 @@ class CurlDownloader
|
||||||
);
|
);
|
||||||
|
|
||||||
$usingProxy = !empty($options['http']['proxy']) ? ' using proxy ' . $options['http']['proxy'] : '';
|
$usingProxy = !empty($options['http']['proxy']) ? ' using proxy ' . $options['http']['proxy'] : '';
|
||||||
$ifModified = false !== strpos(strtolower(implode(',', $options['http']['header'])), 'if-modified-since:') ? ' if modified' : '';
|
$ifModified = false !== stripos(implode(',', $options['http']['header']), 'if-modified-since:') ? ' if modified' : '';
|
||||||
if ($attributes['redirects'] === 0) {
|
if ($attributes['redirects'] === 0) {
|
||||||
$this->io->writeError('Downloading ' . Url::sanitize($url) . $usingProxy . $ifModified, true, IOInterface::DEBUG);
|
$this->io->writeError('Downloading ' . Url::sanitize($url) . $usingProxy . $ifModified, true, IOInterface::DEBUG);
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,7 +273,7 @@ class Perforce
|
||||||
if ($useClient) {
|
if ($useClient) {
|
||||||
$p4Command .= '-c ' . $this->getClient() . ' ';
|
$p4Command .= '-c ' . $this->getClient() . ' ';
|
||||||
}
|
}
|
||||||
$p4Command = $p4Command . '-p ' . $this->getPort() . ' ' . $command;
|
$p4Command .= '-p ' . $this->getPort() . ' ' . $command;
|
||||||
|
|
||||||
return $p4Command;
|
return $p4Command;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue