1
0
Fork 0

Fixes for implicit variable declarations, return type mismatches and invalid method declarations.

pull/4972/head
Niels Keurentjes 2016-02-27 23:39:57 +01:00
parent b059cbe37c
commit f794ee7870
7 changed files with 26 additions and 8 deletions

View File

@ -40,6 +40,7 @@ class FileDownloader implements DownloaderInterface
protected $cache;
protected $outputProgress = true;
private $lastCacheWrites = array();
private $eventDispatcher;
/**
* Constructor.

View File

@ -21,6 +21,7 @@ use Composer\Util\Perforce;
*/
class PerforceDownloader extends VcsDownloader
{
/** @var Perforce */
protected $perforce;
/**
@ -34,7 +35,7 @@ class PerforceDownloader extends VcsDownloader
$this->io->writeError(' Cloning ' . $ref);
$this->initPerforce($package, $path, $url);
$this->perforce->setStream($ref);
$this->perforce->p4Login($this->io);
$this->perforce->p4Login();
$this->perforce->writeP4ClientSpec();
$this->perforce->connectClient();
$this->perforce->syncCodeBase($label);
@ -51,7 +52,7 @@ class PerforceDownloader extends VcsDownloader
return null;
}
public function initPerforce($package, $path, $url)
public function initPerforce(PackageInterface $package, $path, $url)
{
if (!empty($this->perforce)) {
$this->perforce->initializePath($path);

View File

@ -23,10 +23,11 @@ class AliasPackage extends BasePackage implements CompletePackageInterface
protected $version;
protected $prettyVersion;
protected $dev;
protected $aliasOf;
protected $rootPackageAlias = false;
protected $stability;
/** @var PackageInterface */
protected $aliasOf;
/** @var Link[] */
protected $requires;
/** @var Link[] */

View File

@ -38,6 +38,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
protected $loader;
protected $repoConfig;
protected $branchErrorOccurred = false;
private $drivers;
public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $dispatcher = null, array $drivers = null)
{
@ -77,6 +78,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
if (isset($this->drivers[$this->type])) {
$class = $this->drivers[$this->type];
$driver = new $class($this->repoConfig, $this->io, $this->config);
/** @var VcsDriverInterface $driver */
$driver->initialize();
return $driver;
@ -85,6 +87,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
foreach ($this->drivers as $driver) {
if ($driver::supports($this->io, $this->config, $this->url)) {
$driver = new $driver($this->repoConfig, $this->io, $this->config);
/** @var VcsDriverInterface $driver */
$driver->initialize();
return $driver;
@ -94,6 +97,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
foreach ($this->drivers as $driver) {
if ($driver::supports($this->io, $this->config, $this->url, true)) {
$driver = new $driver($this->repoConfig, $this->io, $this->config);
/** @var VcsDriverInterface $driver */
$driver->initialize();
return $driver;

View File

@ -244,6 +244,7 @@ class Perforce
return $value;
}
}
return null;
} else {
$command = 'echo $' . $name;
$this->executeCommand($command);
@ -516,18 +517,22 @@ class Perforce
return false;
}
/**
* @param $reference
* @return mixed|null
*/
protected function getChangeList($reference)
{
$index = strpos($reference, '@');
if ($index === false) {
return;
return null;
}
$label = substr($reference, $index);
$command = $this->generateP4Command(' changes -m1 ' . $label);
$this->executeCommand($command);
$changes = $this->commandResult;
if (strpos($changes, 'Change') !== 0) {
return;
return null;
}
$fields = explode(' ', $changes);
$changeList = $fields[1];
@ -535,15 +540,20 @@ class Perforce
return $changeList;
}
/**
* @param $fromReference
* @param $toReference
* @return mixed|null
*/
public function getCommitLogs($fromReference, $toReference)
{
$fromChangeList = $this->getChangeList($fromReference);
if ($fromChangeList == null) {
return;
return null;
}
$toChangeList = $this->getChangeList($toReference);
if ($toChangeList == null) {
return;
return null;
}
$index = strpos($fromReference, '@');
$main = substr($fromReference, 0, $index) . '/...';

View File

@ -25,6 +25,7 @@ class RemoteFilesystem
{
private $io;
private $config;
private $scheme;
private $bytesMax;
private $originUrl;
private $fileUrl;

View File

@ -247,7 +247,7 @@ EOT;
/**
* Convert certificate name into matching function.
*
* @param $certName CN/SAN
* @param string $certName CN/SAN
*
* @return callable|null
*/