From f3722a46ed8af5858d6bc6fa11caba8f62a050e4 Mon Sep 17 00:00:00 2001 From: matt-whittom Date: Fri, 16 Aug 2013 09:37:11 -0500 Subject: [PATCH] Updated comments --- .../Downloader/PerforceDownloader.php | 17 +++--- .../Repository/Vcs/PerforceDriver.php | 55 ++++++++++++------- 2 files changed, 42 insertions(+), 30 deletions(-) diff --git a/src/Composer/Downloader/PerforceDownloader.php b/src/Composer/Downloader/PerforceDownloader.php index 5cede4ff6..e68315668 100644 --- a/src/Composer/Downloader/PerforceDownloader.php +++ b/src/Composer/Downloader/PerforceDownloader.php @@ -51,19 +51,10 @@ class PerforceDownloader extends VcsDownloader return; } $repository = $package->getRepository(); - $repoConfig = $this->getRepoConfig($repository); + $repoConfig = $repository->getRepoConfig(); $this->perforce = Perforce::createPerforce($repoConfig, $package->getSourceUrl(), $path); } - public function injectPerforce($perforce){ - $this->perforce = $perforce; - $this->perforceInjected = true; - } - - private function getRepoConfig(VcsRepository $repository){ - return $repository->getRepoConfig(); - } - /** * {@inheritDoc} */ @@ -91,4 +82,10 @@ class PerforceDownloader extends VcsDownloader return $commitLogs; } + public function injectPerforce($perforce){ + $this->perforce = $perforce; + $this->perforceInjected = true; + } + + } diff --git a/src/Composer/Repository/Vcs/PerforceDriver.php b/src/Composer/Repository/Vcs/PerforceDriver.php index 7068ebb3e..4918cca5c 100644 --- a/src/Composer/Repository/Vcs/PerforceDriver.php +++ b/src/Composer/Repository/Vcs/PerforceDriver.php @@ -34,7 +34,8 @@ class PerforceDriver extends VcsDriver { /** * {@inheritDoc} */ - public function initialize() { + public function initialize() + { $this->depot = $this->repoConfig['depot']; $this->branch = ""; if (isset($this->repoConfig['branch'])) { @@ -51,7 +52,8 @@ class PerforceDriver extends VcsDriver { return TRUE; } - private function initPerforce() { + private function initPerforce() + { if (isset($this->perforce)) { return; } @@ -60,15 +62,11 @@ class PerforceDriver extends VcsDriver { $this->perforce = Perforce::createPerforce($this->repoConfig, $this->getUrl(), $repoDir, $this->process); } - public function injectPerforce(Perforce $perforce) { - $this->perforce = $perforce; - } - - /** * {@inheritDoc} */ - public function getComposerInformation($identifier) { + public function getComposerInformation($identifier) + { if (isset($this->composer_info_identifier)){ if (strcmp($identifier, $this->composer_info_identifier) === 0 ) { @@ -83,14 +81,16 @@ class PerforceDriver extends VcsDriver { /** * {@inheritDoc} */ - public function getRootIdentifier() { + public function getRootIdentifier() + { return $this->branch; } /** * {@inheritDoc} */ - public function getBranches() { + public function getBranches() + { $branches = $this->perforce->getBranches(); return $branches; @@ -99,7 +99,8 @@ class PerforceDriver extends VcsDriver { /** * {@inheritDoc} */ - public function getTags() { + public function getTags() + { $tags = $this->perforce->getTags(); return $tags; @@ -108,14 +109,16 @@ class PerforceDriver extends VcsDriver { /** * {@inheritDoc} */ - public function getDist($identifier) { + public function getDist($identifier) + { return NULL; } /** * {@inheritDoc} */ - public function getSource($identifier) { + public function getSource($identifier) + { $source = array( 'type' => 'perforce', 'url' => $this->repoConfig['url'], @@ -128,14 +131,16 @@ class PerforceDriver extends VcsDriver { /** * {@inheritDoc} */ - public function getUrl() { + public function getUrl() + { return $this->url; } /** * {@inheritDoc} */ - public function hasComposerFile($identifier) { + public function hasComposerFile($identifier) + { $this->composer_info = $this->perforce->getComposerInformation("//$this->depot/$identifier"); $this->composer_info_identifier = $identifier; $result = false; @@ -148,30 +153,40 @@ class PerforceDriver extends VcsDriver { /** * {@inheritDoc} */ - public function getContents($url) { + public function getContents($url) + { return FALSE; } /** * {@inheritDoc} */ - public static function supports(IOInterface $io, $url, $deep = FALSE) { + public static function supports(IOInterface $io, $url, $deep = FALSE) + { return Perforce::checkServerExists($url, new ProcessExecutor); } /** * {@inheritDoc} */ - public function cleanup(){ + public function cleanup() + { $this->perforce->cleanupClientSpec(); $this->perforce = null; } - public function getDepot(){ + public function getDepot() + { return $this->depot; } - public function getBranch(){ + public function getBranch() + { return $this->branch; } + + public function injectPerforce(Perforce $perforce) + { + $this->perforce = $perforce; + } }