Code style fixes

This commit is contained in:
Dmitry Khomutov 2017-01-13 22:35:41 +07:00
commit 1237bf450c
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
88 changed files with 205 additions and 261 deletions

View file

@ -89,7 +89,7 @@ class Builder implements LoggerAwareInterface
protected $pluginExecutor;
/**
* @var Helper\CommandExecutor
* @var Helper\CommandExecutorInterface
*/
protected $commandExecutor;

View file

@ -17,7 +17,7 @@ use Psr\Log\LogLevel;
* Handles running system commands with variables.
* @package PHPCensor\Helper
*/
abstract class BaseCommandExecutor implements CommandExecutor
abstract class BaseCommandExecutor implements CommandExecutorInterface
{
/**
* @var BuildLogger

View file

@ -9,7 +9,7 @@
namespace PHPCensor\Helper;
interface CommandExecutor
interface CommandExecutorInterface
{
/**
* Executes shell commands. Accepts multiple arguments the first

View file

@ -346,8 +346,8 @@ class BuildBase extends Model
*/
public function setId($value)
{
$this->_validateNotNull('Id', $value);
$this->_validateInt('Id', $value);
$this->validateNotNull('Id', $value);
$this->validateInt('Id', $value);
if ($this->data['id'] === $value) {
return;
@ -355,7 +355,7 @@ class BuildBase extends Model
$this->data['id'] = $value;
$this->_setModified('id');
$this->setModified('id');
}
/**
@ -365,8 +365,8 @@ class BuildBase extends Model
*/
public function setProjectId($value)
{
$this->_validateNotNull('ProjectId', $value);
$this->_validateInt('ProjectId', $value);
$this->validateNotNull('ProjectId', $value);
$this->validateInt('ProjectId', $value);
if ($this->data['project_id'] === $value) {
return;
@ -374,7 +374,7 @@ class BuildBase extends Model
$this->data['project_id'] = $value;
$this->_setModified('project_id');
$this->setModified('project_id');
}
/**
@ -384,8 +384,8 @@ class BuildBase extends Model
*/
public function setCommitId($value)
{
$this->_validateNotNull('CommitId', $value);
$this->_validateString('CommitId', $value);
$this->validateNotNull('CommitId', $value);
$this->validateString('CommitId', $value);
if ($this->data['commit_id'] === $value) {
return;
@ -393,7 +393,7 @@ class BuildBase extends Model
$this->data['commit_id'] = $value;
$this->_setModified('commit_id');
$this->setModified('commit_id');
}
/**
@ -403,8 +403,8 @@ class BuildBase extends Model
*/
public function setStatus($value)
{
$this->_validateNotNull('Status', $value);
$this->_validateInt('Status', $value);
$this->validateNotNull('Status', $value);
$this->validateInt('Status', $value);
if ($this->data['status'] === $value) {
return;
@ -412,7 +412,7 @@ class BuildBase extends Model
$this->data['status'] = $value;
$this->_setModified('status');
$this->setModified('status');
}
/**
@ -422,7 +422,7 @@ class BuildBase extends Model
*/
public function setLog($value)
{
$this->_validateString('Log', $value);
$this->validateString('Log', $value);
if ($this->data['log'] === $value) {
return;
@ -430,7 +430,7 @@ class BuildBase extends Model
$this->data['log'] = $value;
$this->_setModified('log');
$this->setModified('log');
}
/**
@ -440,8 +440,8 @@ class BuildBase extends Model
*/
public function setBranch($value)
{
$this->_validateNotNull('Branch', $value);
$this->_validateString('Branch', $value);
$this->validateNotNull('Branch', $value);
$this->validateString('Branch', $value);
if ($this->data['branch'] === $value) {
return;
@ -449,7 +449,7 @@ class BuildBase extends Model
$this->data['branch'] = $value;
$this->_setModified('branch');
$this->setModified('branch');
}
/**
@ -459,7 +459,7 @@ class BuildBase extends Model
*/
public function setCreated($value)
{
$this->_validateDate('Created', $value);
$this->validateDate('Created', $value);
if ($this->data['created'] === $value) {
return;
@ -467,7 +467,7 @@ class BuildBase extends Model
$this->data['created'] = $value;
$this->_setModified('created');
$this->setModified('created');
}
/**
@ -477,7 +477,7 @@ class BuildBase extends Model
*/
public function setStarted($value)
{
$this->_validateDate('Started', $value);
$this->validateDate('Started', $value);
if ($this->data['started'] === $value) {
return;
@ -485,7 +485,7 @@ class BuildBase extends Model
$this->data['started'] = $value;
$this->_setModified('started');
$this->setModified('started');
}
/**
@ -495,7 +495,7 @@ class BuildBase extends Model
*/
public function setFinished($value)
{
$this->_validateDate('Finished', $value);
$this->validateDate('Finished', $value);
if ($this->data['finished'] === $value) {
return;
@ -503,7 +503,7 @@ class BuildBase extends Model
$this->data['finished'] = $value;
$this->_setModified('finished');
$this->setModified('finished');
}
/**
@ -513,7 +513,7 @@ class BuildBase extends Model
*/
public function setCommitterEmail($value)
{
$this->_validateString('CommitterEmail', $value);
$this->validateString('CommitterEmail', $value);
if ($this->data['committer_email'] === $value) {
return;
@ -521,7 +521,7 @@ class BuildBase extends Model
$this->data['committer_email'] = $value;
$this->_setModified('committer_email');
$this->setModified('committer_email');
}
/**
@ -531,7 +531,7 @@ class BuildBase extends Model
*/
public function setCommitMessage($value)
{
$this->_validateString('CommitMessage', $value);
$this->validateString('CommitMessage', $value);
if ($this->data['commit_message'] === $value) {
return;
@ -539,7 +539,7 @@ class BuildBase extends Model
$this->data['commit_message'] = $value;
$this->_setModified('commit_message');
$this->setModified('commit_message');
}
/**
@ -549,7 +549,7 @@ class BuildBase extends Model
*/
public function setExtra($value)
{
$this->_validateString('Extra', $value);
$this->validateString('Extra', $value);
if ($this->data['extra'] === $value) {
return;
@ -557,7 +557,7 @@ class BuildBase extends Model
$this->data['extra'] = $value;
$this->_setModified('extra');
$this->setModified('extra');
}
/**

View file

@ -279,8 +279,8 @@ class BuildErrorBase extends Model
*/
public function setId($value)
{
$this->_validateNotNull('Id', $value);
$this->_validateInt('Id', $value);
$this->validateNotNull('Id', $value);
$this->validateInt('Id', $value);
if ($this->data['id'] === $value) {
return;
@ -288,7 +288,7 @@ class BuildErrorBase extends Model
$this->data['id'] = $value;
$this->_setModified('id');
$this->setModified('id');
}
/**
@ -299,8 +299,8 @@ class BuildErrorBase extends Model
*/
public function setBuildId($value)
{
$this->_validateNotNull('BuildId', $value);
$this->_validateInt('BuildId', $value);
$this->validateNotNull('BuildId', $value);
$this->validateInt('BuildId', $value);
if ($this->data['build_id'] === $value) {
return;
@ -308,7 +308,7 @@ class BuildErrorBase extends Model
$this->data['build_id'] = $value;
$this->_setModified('build_id');
$this->setModified('build_id');
}
/**
@ -319,8 +319,8 @@ class BuildErrorBase extends Model
*/
public function setPlugin($value)
{
$this->_validateNotNull('Plugin', $value);
$this->_validateString('Plugin', $value);
$this->validateNotNull('Plugin', $value);
$this->validateString('Plugin', $value);
if ($this->data['plugin'] === $value) {
return;
@ -328,7 +328,7 @@ class BuildErrorBase extends Model
$this->data['plugin'] = $value;
$this->_setModified('plugin');
$this->setModified('plugin');
}
/**
@ -338,7 +338,7 @@ class BuildErrorBase extends Model
*/
public function setFile($value)
{
$this->_validateString('File', $value);
$this->validateString('File', $value);
if ($this->data['file'] === $value) {
return;
@ -346,7 +346,7 @@ class BuildErrorBase extends Model
$this->data['file'] = $value;
$this->_setModified('file');
$this->setModified('file');
}
/**
@ -356,7 +356,7 @@ class BuildErrorBase extends Model
*/
public function setLineStart($value)
{
$this->_validateInt('LineStart', $value);
$this->validateInt('LineStart', $value);
if ($this->data['line_start'] === $value) {
return;
@ -364,7 +364,7 @@ class BuildErrorBase extends Model
$this->data['line_start'] = $value;
$this->_setModified('line_start');
$this->setModified('line_start');
}
/**
@ -374,7 +374,7 @@ class BuildErrorBase extends Model
*/
public function setLineEnd($value)
{
$this->_validateInt('LineEnd', $value);
$this->validateInt('LineEnd', $value);
if ($this->data['line_end'] === $value) {
return;
@ -382,7 +382,7 @@ class BuildErrorBase extends Model
$this->data['line_end'] = $value;
$this->_setModified('line_end');
$this->setModified('line_end');
}
/**
@ -393,8 +393,8 @@ class BuildErrorBase extends Model
*/
public function setSeverity($value)
{
$this->_validateNotNull('Severity', $value);
$this->_validateInt('Severity', $value);
$this->validateNotNull('Severity', $value);
$this->validateInt('Severity', $value);
if ($this->data['severity'] === $value) {
return;
@ -402,7 +402,7 @@ class BuildErrorBase extends Model
$this->data['severity'] = $value;
$this->_setModified('severity');
$this->setModified('severity');
}
/**
@ -413,8 +413,8 @@ class BuildErrorBase extends Model
*/
public function setMessage($value)
{
$this->_validateNotNull('Message', $value);
$this->_validateString('Message', $value);
$this->validateNotNull('Message', $value);
$this->validateString('Message', $value);
if ($this->data['message'] === $value) {
return;
@ -422,7 +422,7 @@ class BuildErrorBase extends Model
$this->data['message'] = $value;
$this->_setModified('message');
$this->setModified('message');
}
/**
@ -433,8 +433,8 @@ class BuildErrorBase extends Model
*/
public function setCreatedDate($value)
{
$this->_validateNotNull('CreatedDate', $value);
$this->_validateDate('CreatedDate', $value);
$this->validateNotNull('CreatedDate', $value);
$this->validateDate('CreatedDate', $value);
if ($this->data['created_date'] === $value) {
return;
@ -442,7 +442,7 @@ class BuildErrorBase extends Model
$this->data['created_date'] = $value;
$this->_setModified('created_date');
$this->setModified('created_date');
}
/**

View file

@ -201,8 +201,8 @@ class BuildMetaBase extends Model
*/
public function setId($value)
{
$this->_validateNotNull('Id', $value);
$this->_validateInt('Id', $value);
$this->validateNotNull('Id', $value);
$this->validateInt('Id', $value);
if ($this->data['id'] === $value) {
return;
@ -210,7 +210,7 @@ class BuildMetaBase extends Model
$this->data['id'] = $value;
$this->_setModified('id');
$this->setModified('id');
}
/**
@ -221,8 +221,8 @@ class BuildMetaBase extends Model
*/
public function setProjectId($value)
{
$this->_validateNotNull('ProjectId', $value);
$this->_validateInt('ProjectId', $value);
$this->validateNotNull('ProjectId', $value);
$this->validateInt('ProjectId', $value);
if ($this->data['project_id'] === $value) {
return;
@ -230,7 +230,7 @@ class BuildMetaBase extends Model
$this->data['project_id'] = $value;
$this->_setModified('project_id');
$this->setModified('project_id');
}
/**
@ -241,8 +241,8 @@ class BuildMetaBase extends Model
*/
public function setBuildId($value)
{
$this->_validateNotNull('BuildId', $value);
$this->_validateInt('BuildId', $value);
$this->validateNotNull('BuildId', $value);
$this->validateInt('BuildId', $value);
if ($this->data['build_id'] === $value) {
return;
@ -250,7 +250,7 @@ class BuildMetaBase extends Model
$this->data['build_id'] = $value;
$this->_setModified('build_id');
$this->setModified('build_id');
}
/**
@ -261,8 +261,8 @@ class BuildMetaBase extends Model
*/
public function setMetaKey($value)
{
$this->_validateNotNull('MetaKey', $value);
$this->_validateString('MetaKey', $value);
$this->validateNotNull('MetaKey', $value);
$this->validateString('MetaKey', $value);
if ($this->data['meta_key'] === $value) {
return;
@ -270,7 +270,7 @@ class BuildMetaBase extends Model
$this->data['meta_key'] = $value;
$this->_setModified('meta_key');
$this->setModified('meta_key');
}
/**
@ -281,8 +281,8 @@ class BuildMetaBase extends Model
*/
public function setMetaValue($value)
{
$this->_validateNotNull('MetaValue', $value);
$this->_validateString('MetaValue', $value);
$this->validateNotNull('MetaValue', $value);
$this->validateString('MetaValue', $value);
if ($this->data['meta_value'] === $value) {
return;
@ -290,7 +290,7 @@ class BuildMetaBase extends Model
$this->data['meta_value'] = $value;
$this->_setModified('meta_value');
$this->setModified('meta_value');
}
/**

View file

@ -353,8 +353,8 @@ class ProjectBase extends Model
*/
public function setId($value)
{
$this->_validateNotNull('Id', $value);
$this->_validateInt('Id', $value);
$this->validateNotNull('Id', $value);
$this->validateInt('Id', $value);
if ($this->data['id'] === $value) {
return;
@ -362,7 +362,7 @@ class ProjectBase extends Model
$this->data['id'] = $value;
$this->_setModified('id');
$this->setModified('id');
}
/**
@ -373,8 +373,8 @@ class ProjectBase extends Model
*/
public function setTitle($value)
{
$this->_validateNotNull('Title', $value);
$this->_validateString('Title', $value);
$this->validateNotNull('Title', $value);
$this->validateString('Title', $value);
if ($this->data['title'] === $value) {
return;
@ -382,7 +382,7 @@ class ProjectBase extends Model
$this->data['title'] = $value;
$this->_setModified('title');
$this->setModified('title');
}
/**
@ -393,8 +393,8 @@ class ProjectBase extends Model
*/
public function setReference($value)
{
$this->_validateNotNull('Reference', $value);
$this->_validateString('Reference', $value);
$this->validateNotNull('Reference', $value);
$this->validateString('Reference', $value);
if ($this->data['reference'] === $value) {
return;
@ -402,7 +402,7 @@ class ProjectBase extends Model
$this->data['reference'] = $value;
$this->_setModified('reference');
$this->setModified('reference');
}
/**
@ -413,8 +413,8 @@ class ProjectBase extends Model
*/
public function setBranch($value)
{
$this->_validateNotNull('Branch', $value);
$this->_validateString('Branch', $value);
$this->validateNotNull('Branch', $value);
$this->validateString('Branch', $value);
if ($this->data['branch'] === $value) {
return;
@ -422,7 +422,7 @@ class ProjectBase extends Model
$this->data['branch'] = $value;
$this->_setModified('branch');
$this->setModified('branch');
}
/**
@ -432,7 +432,7 @@ class ProjectBase extends Model
*/
public function setSshPrivateKey($value)
{
$this->_validateString('SshPrivateKey', $value);
$this->validateString('SshPrivateKey', $value);
if ($this->data['ssh_private_key'] === $value) {
return;
@ -440,7 +440,7 @@ class ProjectBase extends Model
$this->data['ssh_private_key'] = $value;
$this->_setModified('ssh_private_key');
$this->setModified('ssh_private_key');
}
/**
@ -451,8 +451,8 @@ class ProjectBase extends Model
*/
public function setType($value)
{
$this->_validateNotNull('Type', $value);
$this->_validateString('Type', $value);
$this->validateNotNull('Type', $value);
$this->validateString('Type', $value);
if ($this->data['type'] === $value) {
return;
@ -460,7 +460,7 @@ class ProjectBase extends Model
$this->data['type'] = $value;
$this->_setModified('type');
$this->setModified('type');
}
/**
@ -470,7 +470,7 @@ class ProjectBase extends Model
*/
public function setAccessInformation($value)
{
$this->_validateString('AccessInformation', $value);
$this->validateString('AccessInformation', $value);
if ($this->data['access_information'] === $value) {
return;
@ -478,7 +478,7 @@ class ProjectBase extends Model
$this->data['access_information'] = $value;
$this->_setModified('access_information');
$this->setModified('access_information');
}
/**
@ -488,7 +488,7 @@ class ProjectBase extends Model
*/
public function setLastCommit($value)
{
$this->_validateString('LastCommit', $value);
$this->validateString('LastCommit', $value);
if ($this->data['last_commit'] === $value) {
return;
@ -496,7 +496,7 @@ class ProjectBase extends Model
$this->data['last_commit'] = $value;
$this->_setModified('last_commit');
$this->setModified('last_commit');
}
/**
@ -506,7 +506,7 @@ class ProjectBase extends Model
*/
public function setBuildConfig($value)
{
$this->_validateString('BuildConfig', $value);
$this->validateString('BuildConfig', $value);
if ($this->data['build_config'] === $value) {
return;
@ -514,7 +514,7 @@ class ProjectBase extends Model
$this->data['build_config'] = $value;
$this->_setModified('build_config');
$this->setModified('build_config');
}
/**
@ -524,7 +524,7 @@ class ProjectBase extends Model
*/
public function setSshPublicKey($value)
{
$this->_validateString('SshPublicKey', $value);
$this->validateString('SshPublicKey', $value);
if ($this->data['ssh_public_key'] === $value) {
return;
@ -532,7 +532,7 @@ class ProjectBase extends Model
$this->data['ssh_public_key'] = $value;
$this->_setModified('ssh_public_key');
$this->setModified('ssh_public_key');
}
/**
@ -543,8 +543,8 @@ class ProjectBase extends Model
*/
public function setAllowPublicStatus($value)
{
$this->_validateNotNull('AllowPublicStatus', $value);
$this->_validateInt('AllowPublicStatus', $value);
$this->validateNotNull('AllowPublicStatus', $value);
$this->validateInt('AllowPublicStatus', $value);
if ($this->data['allow_public_status'] === $value) {
return;
@ -552,7 +552,7 @@ class ProjectBase extends Model
$this->data['allow_public_status'] = $value;
$this->_setModified('allow_public_status');
$this->setModified('allow_public_status');
}
/**
@ -563,8 +563,8 @@ class ProjectBase extends Model
*/
public function setArchived($value)
{
$this->_validateNotNull('Archived', $value);
$this->_validateInt('Archived', $value);
$this->validateNotNull('Archived', $value);
$this->validateInt('Archived', $value);
if ($this->data['archived'] === $value) {
return;
@ -572,7 +572,7 @@ class ProjectBase extends Model
$this->data['archived'] = $value;
$this->_setModified('archived');
$this->setModified('archived');
}
/**
@ -583,8 +583,8 @@ class ProjectBase extends Model
*/
public function setGroupId($value)
{
$this->_validateNotNull('GroupId', $value);
$this->_validateInt('GroupId', $value);
$this->validateNotNull('GroupId', $value);
$this->validateInt('GroupId', $value);
if ($this->data['group_id'] === $value) {
return;
@ -592,7 +592,7 @@ class ProjectBase extends Model
$this->data['group_id'] = $value;
$this->_setModified('group_id');
$this->setModified('group_id');
}
/**

View file

@ -119,8 +119,8 @@ class ProjectGroupBase extends Model
*/
public function setId($value)
{
$this->_validateNotNull('Id', $value);
$this->_validateInt('Id', $value);
$this->validateNotNull('Id', $value);
$this->validateInt('Id', $value);
if ($this->data['id'] === $value) {
return;
@ -128,7 +128,7 @@ class ProjectGroupBase extends Model
$this->data['id'] = $value;
$this->_setModified('id');
$this->setModified('id');
}
/**
@ -139,8 +139,8 @@ class ProjectGroupBase extends Model
*/
public function setTitle($value)
{
$this->_validateNotNull('Title', $value);
$this->_validateString('Title', $value);
$this->validateNotNull('Title', $value);
$this->validateString('Title', $value);
if ($this->data['title'] === $value) {
return;
@ -148,7 +148,7 @@ class ProjectGroupBase extends Model
$this->data['title'] = $value;
$this->_setModified('title');
$this->setModified('title');
}
/**

View file

@ -221,8 +221,8 @@ class UserBase extends Model
*/
public function setId($value)
{
$this->_validateNotNull('Id', $value);
$this->_validateInt('Id', $value);
$this->validateNotNull('Id', $value);
$this->validateInt('Id', $value);
if ($this->data['id'] === $value) {
return;
@ -230,7 +230,7 @@ class UserBase extends Model
$this->data['id'] = $value;
$this->_setModified('id');
$this->setModified('id');
}
/**
@ -241,8 +241,8 @@ class UserBase extends Model
*/
public function setEmail($value)
{
$this->_validateNotNull('Email', $value);
$this->_validateString('Email', $value);
$this->validateNotNull('Email', $value);
$this->validateString('Email', $value);
if ($this->data['email'] === $value) {
return;
@ -250,7 +250,7 @@ class UserBase extends Model
$this->data['email'] = $value;
$this->_setModified('email');
$this->setModified('email');
}
/**
@ -261,8 +261,8 @@ class UserBase extends Model
*/
public function setHash($value)
{
$this->_validateNotNull('Hash', $value);
$this->_validateString('Hash', $value);
$this->validateNotNull('Hash', $value);
$this->validateString('Hash', $value);
if ($this->data['hash'] === $value) {
return;
@ -270,7 +270,7 @@ class UserBase extends Model
$this->data['hash'] = $value;
$this->_setModified('hash');
$this->setModified('hash');
}
/**
@ -281,8 +281,8 @@ class UserBase extends Model
*/
public function setIsAdmin($value)
{
$this->_validateNotNull('IsAdmin', $value);
$this->_validateInt('IsAdmin', $value);
$this->validateNotNull('IsAdmin', $value);
$this->validateInt('IsAdmin', $value);
if ($this->data['is_admin'] === $value) {
return;
@ -290,7 +290,7 @@ class UserBase extends Model
$this->data['is_admin'] = $value;
$this->_setModified('is_admin');
$this->setModified('is_admin');
}
/**
@ -301,8 +301,8 @@ class UserBase extends Model
*/
public function setName($value)
{
$this->_validateNotNull('Name', $value);
$this->_validateString('Name', $value);
$this->validateNotNull('Name', $value);
$this->validateString('Name', $value);
if ($this->data['name'] === $value) {
return;
@ -310,7 +310,7 @@ class UserBase extends Model
$this->data['name'] = $value;
$this->_setModified('name');
$this->setModified('name');
}
/**
@ -327,7 +327,7 @@ class UserBase extends Model
$this->data['language'] = $value;
$this->_setModified('language');
$this->setModified('language');
}
/**
@ -344,7 +344,7 @@ class UserBase extends Model
$this->data['per_page'] = $value;
$this->_setModified('per_page');
$this->setModified('per_page');
}
/**

View file

@ -13,9 +13,9 @@ use PHPCensor\Builder;
use PHPCensor\Helper\Lang;
use PHPCensor\Model\Build;
use PHPCensor\Plugin\Util\TestResultParsers\Codeception as Parser;
use Psr\Log\LogLevel;
use PHPCensor\Plugin;
use PHPCensor\ZeroConfigPlugin;
use PHPCensor\ZeroConfigPluginInterface;
use Psr\Log\LogLevel;
/**
* Codeception Plugin - Enables full acceptance, unit, and functional testing.
@ -26,7 +26,7 @@ use PHPCensor\ZeroConfigPlugin;
* @package PHPCI
* @subpackage Plugins
*/
class Codeception extends Plugin implements ZeroConfigPlugin
class Codeception extends Plugin implements ZeroConfigPluginInterface
{
/** @var string */
protected $args = '';
@ -142,7 +142,7 @@ class Codeception extends Plugin implements ZeroConfigPlugin
$this->builder->log(
'Codeception XML path: '. $this->builder->buildPath . $this->path . 'report.xml',
Loglevel::DEBUG
LogLevel::DEBUG
);
$xml = file_get_contents($this->builder->buildPath . $this->path . 'report.xml', false);

View file

@ -13,7 +13,7 @@ use PHPCensor;
use PHPCensor\Builder;
use PHPCensor\Model\Build;
use PHPCensor\Plugin;
use PHPCensor\ZeroConfigPlugin;
use PHPCensor\ZeroConfigPluginInterface;
/**
* Composer Plugin - Provides access to Composer functionality.
@ -22,7 +22,7 @@ use PHPCensor\ZeroConfigPlugin;
* @package PHPCI
* @subpackage Plugins
*/
class Composer extends Plugin implements ZeroConfigPlugin
class Composer extends Plugin implements ZeroConfigPluginInterface
{
protected $directory;
protected $action;

View file

@ -9,13 +9,8 @@
namespace PHPCensor\Plugin;
use b8\Config;
use b8\ViewRuntimeException;
use Exception;
use b8\View;
use PHPCensor\Builder;
use PHPCensor\Helper\Lang;
use PHPCensor\Model\Build;
use PHPCensor\Helper\Email as EmailHelper;
use Psr\Log\LogLevel;
use PHPCensor\Plugin;
@ -57,7 +52,7 @@ class Email extends Plugin
try {
$view = $this->getMailTemplate();
} catch (ViewRuntimeException $e) {
} catch (\RuntimeException $e) {
$this->builder->log(
sprintf('Unknown mail template "%s", falling back to default.', $this->options['template']),
LogLevel::WARNING

View file

@ -9,9 +9,7 @@
namespace PHPCensor\Plugin;
use PHPCensor\Builder;
use PHPCensor\Helper\Lang;
use PHPCensor\Model\Build;
use PHPCensor\Plugin;
/**

View file

@ -9,9 +9,7 @@
namespace PHPCensor\Plugin;
use PHPCensor\Builder;
use PHPCensor\Helper\Lang;
use PHPCensor\Model\Build;
use PHPCensor\Plugin;
/**

View file

@ -2,7 +2,6 @@
namespace PHPCensor\Plugin;
use Exception;
use PHPCensor\Builder;
use PHPCensor\Helper\Lang;
use PHPCensor\Model\Build;
@ -204,7 +203,7 @@ class Phar extends Plugin
}
$success = true;
} catch (Exception $e) {
} catch (\Exception $e) {
$this->builder->log(Lang::get('phar_internal_error'));
$this->builder->log($e->getMessage());
}

View file

@ -14,7 +14,7 @@ use PHPCensor\Builder;
use PHPCensor\Model\Build;
use PHPCensor\Model\BuildError;
use PHPCensor\Plugin;
use PHPCensor\ZeroConfigPlugin;
use PHPCensor\ZeroConfigPluginInterface;
/**
* PHP Code Sniffer Plugin - Allows PHP Code Sniffer testing.
@ -23,7 +23,7 @@ use PHPCensor\ZeroConfigPlugin;
* @package PHPCI
* @subpackage Plugins
*/
class PhpCodeSniffer extends Plugin implements ZeroConfigPlugin
class PhpCodeSniffer extends Plugin implements ZeroConfigPluginInterface
{
/**
* @var array

View file

@ -14,7 +14,7 @@ use PHPCensor\Helper\Lang;
use PHPCensor\Model\Build;
use PHPCensor\Model\BuildError;
use PHPCensor\Plugin;
use PHPCensor\ZeroConfigPlugin;
use PHPCensor\ZeroConfigPluginInterface;
/**
* PHP Copy / Paste Detector - Allows PHP Copy / Paste Detector testing.
@ -23,7 +23,7 @@ use PHPCensor\ZeroConfigPlugin;
* @package PHPCI
* @subpackage Plugins
*/
class PhpCpd extends Plugin implements ZeroConfigPlugin
class PhpCpd extends Plugin implements ZeroConfigPluginInterface
{
protected $directory;
protected $args;

View file

@ -13,7 +13,7 @@ use PHPCensor;
use PHPCensor\Builder;
use PHPCensor\Model\Build;
use PHPCensor\Plugin;
use PHPCensor\ZeroConfigPlugin;
use PHPCensor\ZeroConfigPluginInterface;
/**
* PHP Docblock Checker Plugin - Checks your PHP files for appropriate uses of Docblocks
@ -22,7 +22,7 @@ use PHPCensor\ZeroConfigPlugin;
* @package PHPCI
* @subpackage Plugins
*/
class PhpDocblockChecker extends Plugin implements ZeroConfigPlugin
class PhpDocblockChecker extends Plugin implements ZeroConfigPluginInterface
{
/**
* @var string Based on the assumption the root may not hold the code to be

View file

@ -13,7 +13,7 @@ use PHPCensor;
use PHPCensor\Builder;
use PHPCensor\Model\Build;
use PHPCensor\Plugin;
use PHPCensor\ZeroConfigPlugin;
use PHPCensor\ZeroConfigPluginInterface;
/**
* PHP Loc - Allows PHP Copy / Lines of Code testing.
@ -22,7 +22,7 @@ use PHPCensor\ZeroConfigPlugin;
* @package PHPCI
* @subpackage Plugins
*/
class PhpLoc extends Plugin implements ZeroConfigPlugin
class PhpLoc extends Plugin implements ZeroConfigPluginInterface
{
/**
* @var string

View file

@ -13,7 +13,7 @@ use PHPCensor;
use PHPCensor\Builder;
use PHPCensor\Model\Build;
use PHPCensor\Plugin;
use PHPCensor\ZeroConfigPlugin;
use PHPCensor\ZeroConfigPluginInterface;
/**
* PHP Mess Detector Plugin - Allows PHP Mess Detector testing.
@ -22,7 +22,7 @@ use PHPCensor\ZeroConfigPlugin;
* @package PHPCI
* @subpackage Plugins
*/
class PhpMessDetector extends Plugin implements ZeroConfigPlugin
class PhpMessDetector extends Plugin implements ZeroConfigPluginInterface
{
/**
* @var array

View file

@ -12,7 +12,7 @@ namespace PHPCensor\Plugin;
use PHPCensor\Builder;
use PHPCensor\Model\Build;
use PHPCensor\Plugin;
use PHPCensor\ZeroConfigPlugin;
use PHPCensor\ZeroConfigPluginInterface;
/**
* Php Parallel Lint Plugin - Provides access to PHP lint functionality.
@ -21,7 +21,7 @@ use PHPCensor\ZeroConfigPlugin;
* @package PHPCI
* @subpackage Plugins
*/
class PhpParallelLint extends Plugin implements ZeroConfigPlugin
class PhpParallelLint extends Plugin implements ZeroConfigPluginInterface
{
/**
* @var string

View file

@ -10,8 +10,6 @@
namespace PHPCensor\Plugin;
use PHPCensor;
use PHPCensor\Builder;
use PHPCensor\Model\Build;
use PHPCensor\Plugin;
/**

View file

@ -17,7 +17,7 @@ use PHPCensor\Model\BuildError;
use PHPCensor\Plugin\Option\PhpUnitOptions;
use PHPCensor\Plugin\Util\PhpUnitResult;
use PHPCensor\Plugin;
use PHPCensor\ZeroConfigPlugin;
use PHPCensor\ZeroConfigPluginInterface;
/**
* PHP Unit Plugin - A rewrite of the original PHP Unit plugin
@ -27,7 +27,7 @@ use PHPCensor\ZeroConfigPlugin;
* @package PHPCI
* @subpackage Plugins
*/
class PhpUnit extends Plugin implements ZeroConfigPlugin
class PhpUnit extends Plugin implements ZeroConfigPluginInterface
{
/** @var string[] Raw options from the PHPCI config file */
protected $options = array();

6
src/PHPCensor/Plugin/TechnicalDebt.php Executable file → Normal file
View file

@ -13,7 +13,7 @@ use PHPCensor;
use PHPCensor\Builder;
use PHPCensor\Model\Build;
use PHPCensor\Plugin;
use PHPCensor\ZeroConfigPlugin;
use PHPCensor\ZeroConfigPluginInterface;
/**
* Technical Debt Plugin - Checks for existence of "TODO", "FIXME", etc.
@ -22,7 +22,7 @@ use PHPCensor\ZeroConfigPlugin;
* @package PHPCI
* @subpackage Plugins
*/
class TechnicalDebt extends Plugin implements ZeroConfigPlugin
class TechnicalDebt extends Plugin implements ZeroConfigPluginInterface
{
/**
* @var array
@ -155,7 +155,7 @@ class TechnicalDebt extends Plugin implements ZeroConfigPlugin
$skipFile = true;
}
if ($skipFile == false) {
if ($skipFile === false) {
$files[] = $file->getRealPath();
}
}

View file

@ -35,7 +35,6 @@ class WindowsProcessControl implements ProcessControlInterface
*/
public function kill($pid, $forcefully = false)
{
$output = [];
$result = 1;
exec(sprintf("taskkill /t /pid %d %s 2>nul:", $pid, $forcefully ? '/f' : ''));

View file

@ -9,7 +9,6 @@
namespace PHPCensor\Service;
use PHPCensor\Helper\Lang;
use PHPCensor\Model\User;
use PHPCensor\Store\UserStore;

View file

@ -15,7 +15,7 @@ use PHPCensor\Model\Build;
* PHPCI Plugin Interface - Used by all build plugins.
* @author Dan Cryer <dan@block8.co.uk>
*/
interface ZeroConfigPlugin
interface ZeroConfigPluginInterface
{
public static function canExecute($stage, Builder $builder, Build $build);
}