diff --git a/PHPCI/Builder.php b/PHPCI/Builder.php index 42f98ee1..73486fee 100644 --- a/PHPCI/Builder.php +++ b/PHPCI/Builder.php @@ -141,7 +141,8 @@ class Builder /** * @return string The title of the project being built. */ - public function getBuildProjectTitle() { + public function getBuildProjectTitle() + { return $this->build->getProject()->getTitle(); } diff --git a/PHPCI/Model/Build/GitlabBuild.php b/PHPCI/Model/Build/GitlabBuild.php index 9f456b0a..f3f75ebe 100644 --- a/PHPCI/Model/Build/GitlabBuild.php +++ b/PHPCI/Model/Build/GitlabBuild.php @@ -25,7 +25,8 @@ class GitlabBuild extends RemoteGitBuild */ public function getCommitLink() { - return 'http://'.$this->getProject()->getAccessInformation()["domain"].'/' . $this->getProject()->getReference() . '/commit/' . $this->getCommitId(); + $domain = $this->getProject()->getAccessInformation()["domain"]; + return 'http://' . $domain . '/' . $this->getProject()->getReference() . '/commit/' . $this->getCommitId(); } /** @@ -33,7 +34,8 @@ class GitlabBuild extends RemoteGitBuild */ public function getBranchLink() { - return 'http://'.$this->getProject()->getAccessInformation()["domain"].'/' . $this->getProject()->getReference() . '/tree/' . $this->getBranch(); + $domain = $this->getProject()->getAccessInformation()["domain"]; + return 'http://' . $domain . '/' . $this->getProject()->getReference() . '/tree/' . $this->getBranch(); } /** @@ -44,7 +46,9 @@ class GitlabBuild extends RemoteGitBuild $key = trim($this->getProject()->getGitKey()); if (!empty($key)) { - return $this->getProject()->getAccessInformation()["user"].'@'.$this->getProject()->getAccessInformation()["domain"].':' . $this->getProject()->getReference() . '.git'; + $user = $this->getProject()->getAccessInformation()["user"]; + $domain = $this->getProject()->getAccessInformation()["domain"]; + return $user . '@' . $domain . ':' . $this->getProject()->getReference() . '.git'; } } } diff --git a/PHPCI/Model/Build/LocalBuild.php b/PHPCI/Model/Build/LocalBuild.php index 6804f437..bfb8ac9e 100644 --- a/PHPCI/Model/Build/LocalBuild.php +++ b/PHPCI/Model/Build/LocalBuild.php @@ -25,14 +25,14 @@ class LocalBuild extends Build * Create a working copy by cloning, copying, or similar. */ public function createWorkingCopy(Builder $builder, $buildPath) - { + { $reference = $this->getProject()->getReference(); $reference = substr($reference, -1) == '/' ? substr($reference, 0, -1) : $reference; $buildPath = substr($buildPath, 0, -1); // If there's a /config file in the reference directory, it is probably a bare repository // which we'll extract into our build path directly. - if(is_file($reference.'/config') && $this->handleBareRepository($builder, $reference, $buildPath) === true) { + if (is_file($reference.'/config') && $this->handleBareRepository($builder, $reference, $buildPath) === true) { return true; } @@ -56,7 +56,7 @@ class LocalBuild extends Build $gitConfig = parse_ini_file($reference.'/config', true); // If it is indeed a bare repository, then extract it into our build path: - if($gitConfig['core']['bare']) { + if ($gitConfig['core']['bare']) { $builder->executeCommand('git --git-dir="%s" archive master | tar -x -C "%s"', $reference, $buildPath); return true; } diff --git a/PHPCI/Plugin/CleanBuild.php b/PHPCI/Plugin/CleanBuild.php index bfe96761..a7db4fc9 100644 --- a/PHPCI/Plugin/CleanBuild.php +++ b/PHPCI/Plugin/CleanBuild.php @@ -11,6 +11,7 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Model\Build; + /** * Clean build removes Composer related files and allows PHPCI users to clean up their build directory. * Useful as a precursor to copy_build. @@ -23,7 +24,7 @@ class CleanBuild implements \PHPCI\Plugin protected $remove; protected $phpci; - public function __construct(Builder $phpci, Build $build, array $options = array()) + public function __construct(Builder $phpci, Build $build, array $options = array()) { $this->phpci = $phpci; $this->remove = isset($options['remove']) && is_array($options['remove']) ? $options['remove'] : array(); diff --git a/PHPCI/Plugin/CopyBuild.php b/PHPCI/Plugin/CopyBuild.php index 1ba06558..494a0d3f 100644 --- a/PHPCI/Plugin/CopyBuild.php +++ b/PHPCI/Plugin/CopyBuild.php @@ -11,6 +11,7 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Model\Build; + /** * Copy Build Plugin - Copies the entire build to another directory. * @author Dan Cryer @@ -22,7 +23,7 @@ class CopyBuild implements \PHPCI\Plugin protected $directory; protected $phpci; - public function __construct(Builder $phpci, Build $build, array $options = array()) + public function __construct(Builder $phpci, Build $build, array $options = array()) { $path = $phpci->buildPath; $this->phpci = $phpci; diff --git a/PHPCI/Plugin/Irc.php b/PHPCI/Plugin/Irc.php index a4a3310b..6b294d66 100644 --- a/PHPCI/Plugin/Irc.php +++ b/PHPCI/Plugin/Irc.php @@ -55,7 +55,7 @@ class Irc implements \PHPCI\Plugin fputs($sock, 'NICK ' . $this->nick . "\r\n"); fputs($sock, 'PRIVMSG ' . $this->room . ' :' . $msg . "\r\n"); - while ($res = fgets($sock)) { + while (fgets($sock)) { // We don't need to do anything, // but the IRC server doesn't appear to post the message // unless we wait for responses. diff --git a/PHPCI/Plugin/PackageBuild.php b/PHPCI/Plugin/PackageBuild.php index d2332ed3..3036d13b 100644 --- a/PHPCI/Plugin/PackageBuild.php +++ b/PHPCI/Plugin/PackageBuild.php @@ -11,6 +11,7 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Model\Build; + /** * Create a ZIP or TAR.GZ archive of the entire build. * @author Dan Cryer @@ -24,7 +25,7 @@ class PackageBuild implements \PHPCI\Plugin protected $format; protected $phpci; - public function __construct(Builder $phpci, Build $build, array $options = array()) + public function __construct(Builder $phpci, Build $build, array $options = array()) { $path = $phpci->buildPath; $this->build = $build; diff --git a/PHPCI/Store/BuildMetaStore.php b/PHPCI/Store/BuildMetaStore.php index 7450ac2a..ad17ef93 100644 --- a/PHPCI/Store/BuildMetaStore.php +++ b/PHPCI/Store/BuildMetaStore.php @@ -6,8 +6,6 @@ namespace PHPCI\Store; -require_once(APPLICATION_PATH . 'PHPCI/Store/Base/BuildMetaStoreBase.php'); - use PHPCI\Store\Base\BuildMetaStoreBase; /** @@ -16,5 +14,5 @@ use PHPCI\Store\Base\BuildMetaStoreBase; */ class BuildMetaStore extends BuildMetaStoreBase { - // This class has been left blank so that you can modify it - changes in this file will not be overwritten. -} \ No newline at end of file + // This class has been left blank so that you can modify it - changes in this file will not be overwritten. +} diff --git a/vars.php b/vars.php index eb5557f4..89a1d81e 100644 --- a/vars.php +++ b/vars.php @@ -24,4 +24,4 @@ if (!defined('ENABLE_SHELL_PLUGIN')) { // If this is not already defined, we're not running in the console: if (!defined('PHPCI_IS_CONSOLE')) { define('PHPCI_IS_CONSOLE', false); -} \ No newline at end of file +}