diff --git a/src/Composer/Downloader/FileDownloader.php b/src/Composer/Downloader/FileDownloader.php index 1a30fd71e..4d35b31a3 100644 --- a/src/Composer/Downloader/FileDownloader.php +++ b/src/Composer/Downloader/FileDownloader.php @@ -40,6 +40,7 @@ class FileDownloader implements DownloaderInterface protected $cache; protected $outputProgress = true; private $lastCacheWrites = array(); + private $eventDispatcher; /** * Constructor. diff --git a/src/Composer/Downloader/PerforceDownloader.php b/src/Composer/Downloader/PerforceDownloader.php index 0acc60f84..6b01bf516 100644 --- a/src/Composer/Downloader/PerforceDownloader.php +++ b/src/Composer/Downloader/PerforceDownloader.php @@ -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); diff --git a/src/Composer/Package/AliasPackage.php b/src/Composer/Package/AliasPackage.php index 631b319b9..09ed4fb9b 100644 --- a/src/Composer/Package/AliasPackage.php +++ b/src/Composer/Package/AliasPackage.php @@ -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[] */ diff --git a/src/Composer/Repository/VcsRepository.php b/src/Composer/Repository/VcsRepository.php index 196a47acb..765e73f4f 100644 --- a/src/Composer/Repository/VcsRepository.php +++ b/src/Composer/Repository/VcsRepository.php @@ -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; diff --git a/src/Composer/Util/Perforce.php b/src/Composer/Util/Perforce.php index b57a64a1f..8a341ee5c 100644 --- a/src/Composer/Util/Perforce.php +++ b/src/Composer/Util/Perforce.php @@ -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) . '/...'; diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index e5ea5c2b4..048cc7b6e 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -25,6 +25,7 @@ class RemoteFilesystem { private $io; private $config; + private $scheme; private $bytesMax; private $originUrl; private $fileUrl; diff --git a/src/Composer/Util/TlsHelper.php b/src/Composer/Util/TlsHelper.php index 721e93825..1afb4bb21 100644 --- a/src/Composer/Util/TlsHelper.php +++ b/src/Composer/Util/TlsHelper.php @@ -247,7 +247,7 @@ EOT; /** * Convert certificate name into matching function. * - * @param $certName CN/SAN + * @param string $certName CN/SAN * * @return callable|null */