Fixing some more PHPCS/PHPMD errors

This commit is contained in:
Dan Cryer 2013-10-10 01:12:30 +01:00
parent 77fae9a56d
commit 16003ff01b
9 changed files with 22 additions and 16 deletions

View file

@ -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();
}

View file

@ -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';
}
}
}

View file

@ -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;
}

View file

@ -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();

View file

@ -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 <dan@block8.co.uk>
@ -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;

View file

@ -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.

View file

@ -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 <dan@block8.co.uk>
@ -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;

View file

@ -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.
}
// This class has been left blank so that you can modify it - changes in this file will not be overwritten.
}

View file

@ -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);
}
}