1
0
Fork 0

Several small code improvements

pull/9204/head
Simon Berger 2020-09-11 23:52:31 +02:00
parent 80d71ccb3f
commit 2223b93efd
10 changed files with 6 additions and 17 deletions

View File

@ -147,11 +147,7 @@ class Pool implements \Countable
$candidateVersion = $candidate->getVersion();
if ($candidateName === $name) {
if ($constraint === null || CompilingMatcher::match($constraint, Constraint::OP_EQ, $candidateVersion)) {
return true;
}
return false;
return $constraint === null || CompilingMatcher::match($constraint, Constraint::OP_EQ, $candidateVersion);
}
$provides = $candidate->getProvides();

View File

@ -996,7 +996,7 @@ class Installer
if (!$this->optimizeAutoloader) {
// Force classMapAuthoritative off when not optimizing the
// autoloader
$this->setClassMapAuthoritative();
$this->setClassMapAuthoritative(false);
}
return $this;

View File

@ -35,7 +35,7 @@ class HhvmDetector
public function getVersion()
{
if (null !== self::$hhvmVersion) {
return self::$hhvmVersion;
return self::$hhvmVersion ?: null;
}
self::$hhvmVersion = defined('HHVM_VERSION') ? HHVM_VERSION : null;

View File

@ -20,8 +20,6 @@ use Composer\Util\Http\Response;
abstract class BitbucketDriver extends VcsDriver
{
/** @var Cache */
protected $cache;
protected $owner;
protected $repository;
protected $hasIssues;

View File

@ -25,7 +25,6 @@ use Composer\Config;
*/
class GitDriver extends VcsDriver
{
protected $cache;
protected $tags;
protected $branches;
protected $rootIdentifier;

View File

@ -25,7 +25,6 @@ use Composer\Util\Http\Response;
*/
class GitHubDriver extends VcsDriver
{
protected $cache;
protected $owner;
protected $repository;
protected $tags;

View File

@ -28,10 +28,6 @@ use Composer\Downloader\TransportException;
*/
class SvnDriver extends VcsDriver
{
/**
* @var Cache
*/
protected $cache;
protected $baseUrl;
protected $tags;
protected $branches;

View File

@ -79,6 +79,7 @@ class Git
return;
}
$messages[] = '- ' . $protoUrl . "\n" . preg_replace('#^#m', ' ', $this->process->getErrorOutput());
if ($initialClone && isset($origCwd)) {
$this->filesystem->removeDirectory($origCwd);
}

View File

@ -207,7 +207,7 @@ class CurlDownloader
);
$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) {
$this->io->writeError('Downloading ' . Url::sanitize($url) . $usingProxy . $ifModified, true, IOInterface::DEBUG);
}

View File

@ -273,7 +273,7 @@ class Perforce
if ($useClient) {
$p4Command .= '-c ' . $this->getClient() . ' ';
}
$p4Command = $p4Command . '-p ' . $this->getPort() . ' ' . $command;
$p4Command .= '-p ' . $this->getPort() . ' ' . $command;
return $p4Command;
}