Several small code improvements
parent
80d71ccb3f
commit
2223b93efd
|
@ -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();
|
||||
|
|
|
@ -996,7 +996,7 @@ class Installer
|
|||
if (!$this->optimizeAutoloader) {
|
||||
// Force classMapAuthoritative off when not optimizing the
|
||||
// autoloader
|
||||
$this->setClassMapAuthoritative();
|
||||
$this->setClassMapAuthoritative(false);
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -20,8 +20,6 @@ use Composer\Util\Http\Response;
|
|||
|
||||
abstract class BitbucketDriver extends VcsDriver
|
||||
{
|
||||
/** @var Cache */
|
||||
protected $cache;
|
||||
protected $owner;
|
||||
protected $repository;
|
||||
protected $hasIssues;
|
||||
|
|
|
@ -25,7 +25,6 @@ use Composer\Config;
|
|||
*/
|
||||
class GitDriver extends VcsDriver
|
||||
{
|
||||
protected $cache;
|
||||
protected $tags;
|
||||
protected $branches;
|
||||
protected $rootIdentifier;
|
||||
|
|
|
@ -25,7 +25,6 @@ use Composer\Util\Http\Response;
|
|||
*/
|
||||
class GitHubDriver extends VcsDriver
|
||||
{
|
||||
protected $cache;
|
||||
protected $owner;
|
||||
protected $repository;
|
||||
protected $tags;
|
||||
|
|
|
@ -28,10 +28,6 @@ use Composer\Downloader\TransportException;
|
|||
*/
|
||||
class SvnDriver extends VcsDriver
|
||||
{
|
||||
/**
|
||||
* @var Cache
|
||||
*/
|
||||
protected $cache;
|
||||
protected $baseUrl;
|
||||
protected $tags;
|
||||
protected $branches;
|
||||
|
|
|
@ -79,6 +79,7 @@ class Git
|
|||
return;
|
||||
}
|
||||
$messages[] = '- ' . $protoUrl . "\n" . preg_replace('#^#m', ' ', $this->process->getErrorOutput());
|
||||
|
||||
if ($initialClone && isset($origCwd)) {
|
||||
$this->filesystem->removeDirectory($origCwd);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue