Compare commits

...

2 commits

Author SHA1 Message Date
Marco Vito Moscaritolo cfeeaa96b2 Plugin DocBlock clenaup. 2015-04-28 09:12:55 +02:00
Marco Vito Moscaritolo b8443b8af7 Plugin cleanup
* Renamed plugins interface (granted backcompatibility for external plugins)
 * Updated copyright in plugin
 * Dockblock cleanup
2015-04-28 08:50:09 +02:00
43 changed files with 629 additions and 346 deletions

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -10,10 +10,13 @@
namespace PHPCI; namespace PHPCI;
/** /**
* PHPCI Plugin Interface - Used by all build plugins. * PHPCI Plugin Interface - Used by all build plugins.
* @author Dan Cryer <dan@block8.co.uk> *
*/ * @author Dan Cryer <dan@block8.co.uk>
interface Plugin * @deprecated 1.8 Only for backward compatibility
* @see PluginInterface
*/
interface Plugin extends PluginInterface
{ {
public function execute();
} }

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,12 +12,20 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Atoum plugin, runs Atoum tests within a project. * Atoum plugin
* @package PHPCI\Plugin *
* Runs Atoum tests within a project.
*
* @author Sanpi <sanpi@homecomputing.fr>
* @author André Cianfarani <acianfa@gmail.com>
* @author Dan Cryer <dan@block8.co.uk>
* @package PHPCI
* @subpackage Plugins
*/ */
class Atoum implements \PHPCI\Plugin class Atoum implements PluginInterface
{ {
private $args; private $args;
private $config; private $config;
@ -25,6 +33,7 @@ class Atoum implements \PHPCI\Plugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -54,8 +63,7 @@ class Atoum implements \PHPCI\Plugin
} }
/** /**
* Run the Atoum plugin. * {@inheritDocs}
* @return bool
*/ */
public function execute() public function execute()
{ {
@ -84,7 +92,7 @@ class Atoum implements \PHPCI\Plugin
$status = false; $status = false;
$this->phpci->log(Lang::get('no_tests_performed')); $this->phpci->log(Lang::get('no_tests_performed'));
} }
return $status; return $status;
} }
} }

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,16 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Behat BDD Plugin * Behat BDD Plugin
*
* @author Dan Cryer <dan@block8.co.uk> * @author Dan Cryer <dan@block8.co.uk>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
*/ */
class Behat implements \PHPCI\Plugin class Behat implements PluginInterface
{ {
protected $phpci; protected $phpci;
protected $build; protected $build;
@ -55,7 +57,7 @@ class Behat implements \PHPCI\Plugin
} }
/** /**
* Runs Behat tests. * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,15 +12,18 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Campfire Plugin - Allows Campfire API actions. * Campfire Plugin
* strongly based on icecube (http://labs.mimmin.com/icecube) *
* Allows Campfire API actions, strongly based on icecube (http://labs.mimmin.com/icecube)
*
* @author André Cianfarani <acianfa@gmail.com> * @author André Cianfarani <acianfa@gmail.com>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
*/ */
class Campfire implements \PHPCI\Plugin class Campfire implements PluginInterface
{ {
private $url; private $url;
private $authToken; private $authToken;
@ -31,6 +34,7 @@ class Campfire implements \PHPCI\Plugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -58,8 +62,7 @@ class Campfire implements \PHPCI\Plugin
} }
/** /**
* Run the Campfire plugin. * {@inheritDocs}
* @return bool|mixed
*/ */
public function execute() public function execute()
{ {

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -11,15 +11,19 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Clean build removes Composer related files and allows PHPCI users to clean up their build directory. * Clean build Plugin
* Useful as a precursor to copy_build. *
* @author Dan Cryer <dan@block8.co.uk> * Removes Composer related files and allows PHPCI users to clean up their build
* @package PHPCI * directory. Useful as a precursor to copy_build.
* @subpackage Plugins *
*/ * @author Dan Cryer <dan@block8.co.uk>
class CleanBuild implements \PHPCI\Plugin * @package PHPCI
* @subpackage Plugins
*/
class CleanBuild implements PluginInterface
{ {
protected $remove; protected $remove;
protected $phpci; protected $phpci;
@ -45,8 +49,8 @@ class CleanBuild implements \PHPCI\Plugin
} }
/** /**
* Executes Composer and runs a specified command (e.g. install / update) * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
$cmd = 'rm -Rf "%s"'; $cmd = 'rm -Rf "%s"';
@ -57,7 +61,7 @@ class CleanBuild implements \PHPCI\Plugin
$this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.lock'); $this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.lock');
$success = true; $success = true;
foreach ($this->remove as $file) { foreach ($this->remove as $file) {
$ok = $this->phpci->executeCommand($cmd, $this->phpci->buildPath . $file); $ok = $this->phpci->executeCommand($cmd, $this->phpci->buildPath . $file);

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -14,16 +14,21 @@ use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\Plugin\Util\TestResultParsers\Codeception as Parser; use PHPCI\Plugin\Util\TestResultParsers\Codeception as Parser;
use Psr\Log\LogLevel; use Psr\Log\LogLevel;
use PHPCI\PluginInterface;
use PHPCI\PluginZeroConfigInterface;
/** /**
* Codeception Plugin - Enables full acceptance, unit, and functional testing. * Codeception Plugin
*
* Enables full acceptance, unit, and functional testing.
*
* @author Don Gilbert <don@dongilbert.net> * @author Don Gilbert <don@dongilbert.net>
* @author Igor Timoshenko <contact@igortimoshenko.com> * @author Igor Timoshenko <contact@igortimoshenko.com>
* @author Adam Cooper <adam@networkpie.co.uk> * @author Adam Cooper <adam@networkpie.co.uk>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
*/ */
class Codeception implements \PHPCI\Plugin, \PHPCI\ZeroConfigPlugin class Codeception implements PluginInterface, PluginZeroConfigInterface
{ {
/** @var string */ /** @var string */
protected $args = ''; protected $args = '';
@ -45,10 +50,7 @@ class Codeception implements \PHPCI\Plugin, \PHPCI\ZeroConfigPlugin
protected $path; protected $path;
/** /**
* @param $stage * {@inheritDocs}
* @param Builder $builder
* @param Build $build
* @return bool
*/ */
public static function canExecute($stage, Builder $builder, Build $build) public static function canExecute($stage, Builder $builder, Build $build)
{ {
@ -61,7 +63,9 @@ class Codeception implements \PHPCI\Plugin, \PHPCI\ZeroConfigPlugin
/** /**
* Try and find the codeception YML config file. * Try and find the codeception YML config file.
*
* @param $buildPath * @param $buildPath
*
* @return null|string * @return null|string
*/ */
public static function findConfigFile($buildPath) public static function findConfigFile($buildPath)
@ -79,6 +83,7 @@ class Codeception implements \PHPCI\Plugin, \PHPCI\ZeroConfigPlugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -104,7 +109,7 @@ class Codeception implements \PHPCI\Plugin, \PHPCI\ZeroConfigPlugin
} }
/** /**
* Runs Codeception tests, optionally using specified config file(s). * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
@ -123,8 +128,11 @@ class Codeception implements \PHPCI\Plugin, \PHPCI\ZeroConfigPlugin
/** /**
* Run tests from a Codeception config file. * Run tests from a Codeception config file.
*
* @param $configPath * @param $configPath
*
* @return bool|mixed * @return bool|mixed
*
* @throws \Exception * @throws \Exception
*/ */
protected function runConfigFile($configPath) protected function runConfigFile($configPath)

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -13,14 +13,19 @@ use PHPCI;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\PluginInterface;
use PHPCI\PluginZeroConfigInterface;
/** /**
* Composer Plugin - Provides access to Composer functionality. * Composer Plugin
* @author Dan Cryer <dan@block8.co.uk> *
* @package PHPCI * Provides access to Composer functionality.
* @subpackage Plugins *
*/ * @author Dan Cryer <dan@block8.co.uk>
class Composer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin * @package PHPCI
* @subpackage Plugins
*/
class Composer implements PluginInterface, PluginZeroConfigInterface
{ {
protected $directory; protected $directory;
protected $action; protected $action;
@ -29,11 +34,7 @@ class Composer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
protected $build; protected $build;
/** /**
* Check if this plugin can be executed. * {@inheritDocs}
* @param $stage
* @param Builder $builder
* @param Build $build
* @return bool
*/ */
public static function canExecute($stage, Builder $builder, Build $build) public static function canExecute($stage, Builder $builder, Build $build)
{ {
@ -48,6 +49,7 @@ class Composer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -75,8 +77,8 @@ class Composer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
} }
/** /**
* Executes Composer and runs a specified command (e.g. install / update) * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
$composerLocation = $this->phpci->findBinary(array('composer', 'composer.phar')); $composerLocation = $this->phpci->findBinary(array('composer', 'composer.phar'));

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,18 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\PluginInterface;
/** /**
* Copy Build Plugin - Copies the entire build to another directory. * Copy Build Plugin
* @author Dan Cryer <dan@block8.co.uk> *
* @package PHPCI * Copies the entire build to another directory.
* @subpackage Plugins *
*/ * @author Dan Cryer <dan@block8.co.uk>
class CopyBuild implements \PHPCI\Plugin * @package PHPCI
* @subpackage Plugins
*/
class CopyBuild implements PluginInterface
{ {
protected $directory; protected $directory;
protected $ignore; protected $ignore;
@ -29,6 +33,7 @@ class CopyBuild implements \PHPCI\Plugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -44,8 +49,8 @@ class CopyBuild implements \PHPCI\Plugin
} }
/** /**
* Copies files from the root of the build directory into the target folder * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
$build = $this->phpci->buildPath; $build = $this->phpci->buildPath;
@ -70,6 +75,7 @@ class CopyBuild implements \PHPCI\Plugin
/** /**
* Wipe the destination directory if it already exists. * Wipe the destination directory if it already exists.
*
* @throws \Exception * @throws \Exception
*/ */
protected function wipeExistingDirectory() protected function wipeExistingDirectory()

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -14,14 +14,18 @@ use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\Helper\Email as EmailHelper; use PHPCI\Helper\Email as EmailHelper;
use PHPCI\PluginInterface;
/** /**
* Email Plugin - Provides simple email capability to PHPCI. * Email Plugin
* @author Steve Brazier <meadsteve@gmail.com> *
* @package PHPCI * Provides simple email capability to PHPCI.
* @subpackage Plugins *
*/ * @author Steve Brazier <meadsteve@gmail.com>
class Email implements \PHPCI\Plugin * @package PHPCI
* @subpackage Plugins
*/
class Email implements PluginInterface
{ {
/** /**
* @var \PHPCI\Builder * @var \PHPCI\Builder
@ -40,6 +44,7 @@ class Email implements \PHPCI\Plugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param \Swift_Mailer $mailer * @param \Swift_Mailer $mailer
@ -56,7 +61,7 @@ class Email implements \PHPCI\Plugin
} }
/** /**
* Send a notification mail. * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
@ -91,11 +96,14 @@ class Email implements \PHPCI\Plugin
} }
/** /**
* @param string $toAddress Single address to send to * Send a mail using the specified information.
* @param string[] $ccList *
* @param string $subject Email subject * @param string $toAddress Single address to send to
* @param string $body Email body * @param string[] $ccList List of user to CC
* @return array Array of failed addresses * @param string $subject Email subject
* @param string $body Email body
*
* @return array Array of failed addresses
*/ */
public function sendEmail($toAddress, $ccList, $subject, $body) public function sendEmail($toAddress, $ccList, $subject, $body)
{ {
@ -118,14 +126,11 @@ class Email implements \PHPCI\Plugin
/** /**
* Send an email to a list of specified subjects. * Send an email to a list of specified subjects.
* *
* @param array $toAddresses * @param array $toAddresses List of destinatary of message.
* List of destinatary of message. * @param string $subject Mail subject
* @param string $subject * @param string $body Mail body
* Mail subject
* @param string $body
* Mail body
* *
* @return int number of failed messages * @return int number of failed messages
*/ */
public function sendSeparateEmails(array $toAddresses, $subject, $body) public function sendSeparateEmails(array $toAddresses, $subject, $body)
{ {
@ -142,6 +147,7 @@ class Email implements \PHPCI\Plugin
/** /**
* Get the list of email addresses to send to. * Get the list of email addresses to send to.
*
* @return array * @return array
*/ */
protected function getEmailAddresses() protected function getEmailAddresses()
@ -168,6 +174,7 @@ class Email implements \PHPCI\Plugin
/** /**
* Get the list of email addresses to CC. * Get the list of email addresses to CC.
*
* @return array * @return array
*/ */
protected function getCcAddresses() protected function getCcAddresses()

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,16 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Environment variable plugin * Environment variable plugin
* @author Steve Kamerman <stevekamerman@gmail.com> *
* @package PHPCI * @author Steve Kamerman <stevekamerman@gmail.com>
* @subpackage Plugins * @package PHPCI
*/ * @subpackage Plugins
class Env implements \PHPCI\Plugin */
class Env implements PluginInterface
{ {
protected $phpci; protected $phpci;
protected $build; protected $build;
@ -27,6 +29,7 @@ class Env implements \PHPCI\Plugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -39,8 +42,8 @@ class Env implements \PHPCI\Plugin
} }
/** /**
* Adds the specified environment variables to the builder environment * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
$success = true; $success = true;
@ -52,7 +55,7 @@ class Env implements \PHPCI\Plugin
// This allows the standard syntax: "FOO: bar" // This allows the standard syntax: "FOO: bar"
$env_var = "$key=$value"; $env_var = "$key=$value";
} }
if (!putenv($this->phpci->interpolate($env_var))) { if (!putenv($this->phpci->interpolate($env_var))) {
$success = false; $success = false;
$this->phpci->logFailure(Lang::get('unable_to_set_env')); $this->phpci->logFailure(Lang::get('unable_to_set_env'));

View file

@ -0,0 +1,17 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Plugin\Exception;
use PHPCI\Plugin\Exception\PluginException;
class PluginBinaryNotFoundException extends PluginException
{
}

View file

@ -0,0 +1,17 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Plugin\Exception;
use Exception;
class PluginException extends Exception
{
}

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,16 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Git plugin. * Git plugin.
*
* @author Dan Cryer <dan@block8.co.uk> * @author Dan Cryer <dan@block8.co.uk>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
*/ */
class Git implements \PHPCI\Plugin class Git implements PluginInterface
{ {
protected $phpci; protected $phpci;
protected $build; protected $build;
@ -27,6 +29,7 @@ class Git implements \PHPCI\Plugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -39,8 +42,7 @@ class Git implements \PHPCI\Plugin
} }
/** /**
* Run the Git plugin. * {@inheritDocs}
* @return bool
*/ */
public function execute() public function execute()
{ {
@ -70,8 +72,10 @@ class Git implements \PHPCI\Plugin
/** /**
* Determine which action to run, and run it. * Determine which action to run, and run it.
*
* @param $action * @param $action
* @param array $options * @param array $options
*
* @return bool * @return bool
*/ */
protected function runAction($action, array $options = array()) protected function runAction($action, array $options = array())
@ -96,6 +100,7 @@ class Git implements \PHPCI\Plugin
/** /**
* Handle a merge action. * Handle a merge action.
*
* @param $options * @param $options
* @return bool * @return bool
*/ */
@ -110,6 +115,7 @@ class Git implements \PHPCI\Plugin
/** /**
* Handle a tag action. * Handle a tag action.
*
* @param $options * @param $options
* @return bool * @return bool
*/ */
@ -132,6 +138,7 @@ class Git implements \PHPCI\Plugin
/** /**
* Handle a pull action. * Handle a pull action.
*
* @param $options * @param $options
* @return bool * @return bool
*/ */
@ -153,6 +160,7 @@ class Git implements \PHPCI\Plugin
/** /**
* Handle a push action. * Handle a push action.
*
* @param $options * @param $options
* @return bool * @return bool
*/ */

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -11,14 +11,18 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Grunt Plugin - Provides access to grunt functionality. * Grunt Plugin
* @author Tobias Tom <t.tom@succont.de> *
* @package PHPCI * Provides access to grunt functionality.
* @subpackage Plugins *
*/ * @author Tobias Tom <t.tom@succont.de>
class Grunt implements \PHPCI\Plugin * @package PHPCI
* @subpackage Plugins
*/
class Grunt implements PluginInterface
{ {
protected $directory; protected $directory;
protected $task; protected $task;
@ -69,8 +73,8 @@ class Grunt implements \PHPCI\Plugin
} }
/** /**
* Executes grunt and runs a specified command (e.g. install / update) * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
// if npm does not work, we cannot use grunt, so we return false // if npm does not work, we cannot use grunt, so we return false

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -11,14 +11,18 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Gulp Plugin - Provides access to gulp functionality. * Gulp Plugin
* @author Dirk Heilig <dirk@heilig-online.com> *
* @package PHPCI * Provides access to gulp functionality.
* @subpackage Plugins *
*/ * @author Dirk Heilig <dirk@heilig-online.com>
class Gulp implements \PHPCI\Plugin * @package PHPCI
* @subpackage Plugins
*/
class Gulp implements PluginInterface
{ {
protected $directory; protected $directory;
protected $task; protected $task;
@ -69,8 +73,8 @@ class Gulp implements \PHPCI\Plugin
} }
/** /**
* Executes gulp and runs a specified command (e.g. install / update) * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
// if npm does not work, we cannot use gulp, so we return false // if npm does not work, we cannot use gulp, so we return false

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,18 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Hipchat Plugin * Hipchat Plugin.
*
* Send build notification in HipChat.
*
* @author James Inman <james@jamesinman.co.uk> * @author James Inman <james@jamesinman.co.uk>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
*/ */
class HipchatNotify implements \PHPCI\Plugin class HipchatNotify implements PluginInterface
{ {
protected $authToken; protected $authToken;
protected $color; protected $color;
@ -27,9 +31,11 @@ class HipchatNotify implements \PHPCI\Plugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
*
* @throws \Exception * @throws \Exception
*/ */
public function __construct(Builder $phpci, Build $build, array $options = array()) public function __construct(Builder $phpci, Build $build, array $options = array())
@ -68,8 +74,7 @@ class HipchatNotify implements \PHPCI\Plugin
} }
/** /**
* Run the HipChat plugin. * {@inheritDocs}
* @return bool
*/ */
public function execute() public function execute()
{ {

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,18 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* IRC Plugin - Sends a notification to an IRC channel * IRC Plugin
*
* Sends a notification to an IRC channel.
*
* @author Dan Cryer <dan@block8.co.uk> * @author Dan Cryer <dan@block8.co.uk>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
*/ */
class Irc implements \PHPCI\Plugin class Irc implements PluginInterface
{ {
protected $phpci; protected $phpci;
protected $build; protected $build;
@ -61,8 +65,7 @@ class Irc implements \PHPCI\Plugin
} }
/** /**
* Run IRC plugin. * {@inheritDocs}
* @return bool
*/ */
public function execute() public function execute()
{ {
@ -93,8 +96,11 @@ class Irc implements \PHPCI\Plugin
} }
/** /**
* Execute a list of IRC commands.
*
* @param resource $socket * @param resource $socket
* @param array $commands * @param array $commands
*
* @return bool * @return bool
*/ */
private function executeIrcCommands($socket, array $commands) private function executeIrcCommands($socket, array $commands)
@ -120,9 +126,11 @@ class Irc implements \PHPCI\Plugin
} }
/** /**
* Execute a single IRC command.
* *
* @param resource $socket * @param resource $socket
* @param string $command * @param string $command
*
* @return bool * @return bool
*/ */
private function executeIrcCommand($socket, $command) private function executeIrcCommand($socket, $command)

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,18 @@ namespace PHPCI\Plugin;
use PHPCI; use PHPCI;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* PHP Lint Plugin - Provides access to PHP lint functionality. * PHP Lint Plugin
*
* Provides access to PHP lint functionality.
*
* @author Dan Cryer <dan@block8.co.uk> * @author Dan Cryer <dan@block8.co.uk>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
*/ */
class Lint implements PHPCI\Plugin class Lint implements PluginInterface
{ {
protected $directories; protected $directories;
protected $recursive = true; protected $recursive = true;
@ -60,7 +64,7 @@ class Lint implements PHPCI\Plugin
} }
/** /**
* Executes parallel lint * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
@ -82,9 +86,11 @@ class Lint implements PHPCI\Plugin
/** /**
* Lint an item (file or directory) by calling the appropriate method. * Lint an item (file or directory) by calling the appropriate method.
*
* @param $php * @param $php
* @param $item * @param $item
* @param $itemPath * @param $itemPath
*
* @return bool * @return bool
*/ */
protected function lintItem($php, $item, $itemPath) protected function lintItem($php, $item, $itemPath)
@ -102,8 +108,10 @@ class Lint implements PHPCI\Plugin
/** /**
* Run php -l against a directory of files. * Run php -l against a directory of files.
*
* @param $php * @param $php
* @param $path * @param $path
*
* @return bool * @return bool
*/ */
protected function lintDirectory($php, $path) protected function lintDirectory($php, $path)
@ -132,8 +140,10 @@ class Lint implements PHPCI\Plugin
/** /**
* Run php -l against a specific file. * Run php -l against a specific file.
*
* @param $php * @param $php
* @param $path * @param $path
*
* @return bool * @return bool
*/ */
protected function lintFile($php, $path) protected function lintFile($php, $path)

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -13,15 +13,19 @@ use PDO;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* MySQL Plugin - Provides access to a MySQL database. * MySQL Plugin
* @author Dan Cryer <dan@block8.co.uk> *
* @author Steve Kamerman <stevekamerman@gmail.com> * Provides access to a MySQL database.
* @package PHPCI *
* @subpackage Plugins * @author Dan Cryer <dan@block8.co.uk>
*/ * @author Steve Kamerman <stevekamerman@gmail.com>
class Mysql implements \PHPCI\Plugin * @package PHPCI
* @subpackage Plugins
*/
class Mysql implements PluginInterface
{ {
/** /**
* @var \PHPCI\Builder * @var \PHPCI\Builder
@ -91,9 +95,8 @@ class Mysql implements \PHPCI\Plugin
} }
/** /**
* Connects to MySQL and runs a specified set of queries. * {@inheritDocs}
* @return boolean */
*/
public function execute() public function execute()
{ {
try { try {
@ -120,7 +123,9 @@ class Mysql implements \PHPCI\Plugin
/** /**
* @param string $query * @param string $query
*
* @return boolean * @return boolean
*
* @throws \Exception * @throws \Exception
*/ */
protected function executeFile($query) protected function executeFile($query)
@ -146,8 +151,10 @@ class Mysql implements \PHPCI\Plugin
/** /**
* Builds the MySQL import command required to import/execute the specified file * Builds the MySQL import command required to import/execute the specified file
*
* @param string $import_file Path to file, relative to the build root * @param string $import_file Path to file, relative to the build root
* @param string $database If specified, this database is selected before execution * @param string $database If specified, this database is selected before execution
*
* @return string * @return string
*/ */
protected function getImportCommand($import_file, $database = null) protected function getImportCommand($import_file, $database = null)

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -11,14 +11,16 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Create a ZIP or TAR.GZ archive of the entire build. * Create a ZIP or TAR.GZ archive of the entire build.
* @author Dan Cryer <dan@block8.co.uk> *
* @package PHPCI * @author Dan Cryer <dan@block8.co.uk>
* @subpackage Plugins * @package PHPCI
*/ * @subpackage Plugins
class PackageBuild implements \PHPCI\Plugin */
class PackageBuild implements PluginInterface
{ {
protected $directory; protected $directory;
protected $filename; protected $filename;
@ -27,6 +29,7 @@ class PackageBuild implements \PHPCI\Plugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -42,8 +45,8 @@ class PackageBuild implements \PHPCI\Plugin
} }
/** /**
* Executes Composer and runs a specified command (e.g. install / update) * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
$path = $this->phpci->buildPath; $path = $this->phpci->buildPath;

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,18 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Pdepend Plugin - Allows Pdepend report * Pdepend Plugin
*
* Allows Pdepend report
*
* @author Johan van der Heide <info@japaveh.nl> * @author Johan van der Heide <info@japaveh.nl>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
*/ */
class Pdepend implements \PHPCI\Plugin class Pdepend implements PluginInterface
{ {
protected $args; protected $args;
/** /**
@ -50,6 +54,7 @@ class Pdepend implements \PHPCI\Plugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -69,7 +74,7 @@ class Pdepend implements \PHPCI\Plugin
} }
/** /**
* Runs Pdepend with the given criteria as arguments * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,18 @@ namespace PHPCI\Plugin;
use PDO; use PDO;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* PgSQL Plugin - Provides access to a PgSQL database. * PgSQL Plugin
* @author Dan Cryer <dan@block8.co.uk> *
* @package PHPCI * Provides access to a PgSQL database.
* @subpackage Plugins *
*/ * @author Dan Cryer <dan@block8.co.uk>
class Pgsql implements \PHPCI\Plugin * @package PHPCI
* @subpackage Plugins
*/
class Pgsql implements PluginInterface
{ {
/** /**
* @var \PHPCI\Builder * @var \PHPCI\Builder
@ -73,9 +77,8 @@ class Pgsql implements \PHPCI\Plugin
} }
/** /**
* Connects to PgSQL and runs a specified set of queries. * {@inheritDocs}
* @return boolean */
*/
public function execute() public function execute()
{ {
try { try {

View file

@ -1,16 +1,31 @@
<?php <?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Plugin; namespace PHPCI\Plugin;
use Exception; use Exception;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
use Phar as PHPPhar; use Phar as PHPPhar;
/** /**
* Phar Plugin * Phar Plugin
*
* Plugin to generate php package using phar format.
*
* @author Wanderson <wandersonwhcr@gmail.com>
* @package PHPCI
* @subpackage Plugins
*/ */
class Phar implements \PHPCI\Plugin class Phar implements PluginInterface
{ {
/** /**
* PHPCI * PHPCI
@ -111,6 +126,7 @@ class Phar implements \PHPCI\Plugin
* Directory Setter * Directory Setter
* *
* @param string $directory Configuration Value * @param string $directory Configuration Value
*
* @return Phar Fluent Interface * @return Phar Fluent Interface
*/ */
public function setDirectory($directory) public function setDirectory($directory)
@ -136,6 +152,7 @@ class Phar implements \PHPCI\Plugin
* Filename Setter * Filename Setter
* *
* @param string $filename Configuration Value * @param string $filename Configuration Value
*
* @return Phar Fluent Interface * @return Phar Fluent Interface
*/ */
public function setFilename($filename) public function setFilename($filename)
@ -161,6 +178,7 @@ class Phar implements \PHPCI\Plugin
* Regular Expression Setter * Regular Expression Setter
* *
* @param string $regexp Configuration Value * @param string $regexp Configuration Value
*
* @return Phar Fluent Interface * @return Phar Fluent Interface
*/ */
public function setRegExp($regexp) public function setRegExp($regexp)
@ -186,6 +204,7 @@ class Phar implements \PHPCI\Plugin
* Stub Filename Setter * Stub Filename Setter
* *
* @param string $stub Configuration Value * @param string $stub Configuration Value
*
* @return Phar Fluent Interface * @return Phar Fluent Interface
*/ */
public function setStub($stub) public function setStub($stub)
@ -206,6 +225,7 @@ class Phar implements \PHPCI\Plugin
/** /**
* Get stub content for the Phar file. * Get stub content for the Phar file.
*
* @return string * @return string
*/ */
public function getStubContent() public function getStubContent()
@ -219,8 +239,7 @@ class Phar implements \PHPCI\Plugin
} }
/** /**
* Run the phar plugin. * {@inheritDocs}
* @return bool
*/ */
public function execute() public function execute()
{ {

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,15 +12,18 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Phing Plugin - Provides access to Phing functionality. * Phing Plugin
*
* Provides access to Phing functionality.
* *
* @author Pavel Pavlov <ppavlov@alera.ru> * @author Pavel Pavlov <ppavlov@alera.ru>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
*/ */
class Phing implements \PHPCI\Plugin class Phing implements PluginInterface
{ {
private $directory; private $directory;
@ -34,6 +37,7 @@ class Phing implements \PHPCI\Plugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -43,9 +47,7 @@ class Phing implements \PHPCI\Plugin
$this->setPhpci($phpci); $this->setPhpci($phpci);
$this->build = $build; $this->build = $build;
/* // Set working directory
* Set working directory
*/
if (isset($options['directory'])) { if (isset($options['directory'])) {
$directory = $phpci->buildPath . '/' . $options['directory']; $directory = $phpci->buildPath . '/' . $options['directory'];
} else { } else {
@ -54,9 +56,7 @@ class Phing implements \PHPCI\Plugin
$this->setDirectory($directory); $this->setDirectory($directory);
/* // Set name of a non default build file
* Sen name of a non default build file
*/
if (isset($options['build_file'])) { if (isset($options['build_file'])) {
$this->setBuildFile($options['build_file']); $this->setBuildFile($options['build_file']);
} }
@ -75,7 +75,7 @@ class Phing implements \PHPCI\Plugin
} }
/** /**
* Executes Phing and runs a specified targets * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
@ -97,7 +97,7 @@ class Phing implements \PHPCI\Plugin
} }
/** /**
* @return \PHPCI\Builder * @return Builder
*/ */
public function getPhpci() public function getPhpci()
{ {
@ -105,7 +105,7 @@ class Phing implements \PHPCI\Plugin
} }
/** /**
* @param \PHPCI\Builder $phpci * @param Builder $phpci
* *
* @return $this * @return $this
*/ */
@ -142,6 +142,7 @@ class Phing implements \PHPCI\Plugin
/** /**
* Converts an array of targets into a string. * Converts an array of targets into a string.
*
* @return string * @return string
*/ */
private function targetsToString() private function targetsToString()
@ -175,6 +176,7 @@ class Phing implements \PHPCI\Plugin
* @param mixed $buildFile * @param mixed $buildFile
* *
* @return $this * @return $this
*
* @throws \Exception * @throws \Exception
*/ */
public function setBuildFile($buildFile) public function setBuildFile($buildFile)
@ -188,6 +190,7 @@ class Phing implements \PHPCI\Plugin
/** /**
* Get phing build file path. * Get phing build file path.
*
* @return string * @return string
*/ */
public function getBuildFilePath() public function getBuildFilePath()
@ -208,10 +211,8 @@ class Phing implements \PHPCI\Plugin
*/ */
public function propertiesToString() public function propertiesToString()
{ {
/** // Fix the problem when execute phing out of the build dir
* fix the problem when execute phing out of the build dir // @ticket 748
* @ticket 748
*/
if (!isset($this->properties['project.basedir'])) { if (!isset($this->properties['project.basedir'])) {
$this->properties['project.basedir'] = $this->getDirectory(); $this->properties['project.basedir'] = $this->getDirectory();
} }
@ -251,6 +252,7 @@ class Phing implements \PHPCI\Plugin
* @param string $propertyFile * @param string $propertyFile
* *
* @return $this * @return $this
*
* @throws \Exception * @throws \Exception
*/ */
public function setPropertyFile($propertyFile) public function setPropertyFile($propertyFile)

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,19 @@ namespace PHPCI\Plugin;
use PHPCI; use PHPCI;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
use PHPCI\PluginZeroConfigInterface;
/** /**
* PHP Code Sniffer Plugin - Allows PHP Code Sniffer testing. * PHP Code Sniffer Plugin
* @author Dan Cryer <dan@block8.co.uk> *
* @package PHPCI * Allows PHP Code Sniffer testing.
* @subpackage Plugins *
*/ * @author Dan Cryer <dan@block8.co.uk>
class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin * @package PHPCI
* @subpackage Plugins
*/
class PhpCodeSniffer implements PluginInterface, PluginZeroConfigInterface
{ {
/** /**
* @var \PHPCI\Builder * @var \PHPCI\Builder
@ -73,11 +78,7 @@ class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
protected $ignore; protected $ignore;
/** /**
* Check if this plugin can be executed. * {@inheritDocs}
* @param $stage
* @param Builder $builder
* @param Build $build
* @return bool
*/ */
public static function canExecute($stage, Builder $builder, Build $build) public static function canExecute($stage, Builder $builder, Build $build)
{ {
@ -129,6 +130,7 @@ class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Handle this plugin's options. * Handle this plugin's options.
*
* @param $options * @param $options
*/ */
protected function setOptions($options) protected function setOptions($options)
@ -141,8 +143,8 @@ class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
} }
/** /**
* Runs PHP Code Sniffer in a specified directory, to a specified standard. * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
list($ignore, $standard, $suffixes) = $this->getFlags(); list($ignore, $standard, $suffixes) = $this->getFlags();
@ -185,6 +187,7 @@ class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Process options and produce an arguments string for PHPCS. * Process options and produce an arguments string for PHPCS.
*
* @return array * @return array
*/ */
protected function getFlags() protected function getFlags()
@ -210,8 +213,11 @@ class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Process the PHPCS output report. * Process the PHPCS output report.
*
* @param $output * @param $output
*
* @return array * @return array
*
* @throws \Exception * @throws \Exception
*/ */
protected function processReport($output) protected function processReport($output)

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,18 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* PHP Copy / Paste Detector - Allows PHP Copy / Paste Detector testing. * PHP Copy / Paste Detector.
* @author Dan Cryer <dan@block8.co.uk> *
* @package PHPCI * Allows PHP Copy / Paste Detector testing.
* @subpackage Plugins *
*/ * @author Dan Cryer <dan@block8.co.uk>
class PhpCpd implements \PHPCI\Plugin * @package PHPCI
* @subpackage Plugins
*/
class PhpCpd implements PluginInterface
{ {
protected $directory; protected $directory;
protected $args; protected $args;
@ -39,6 +43,7 @@ class PhpCpd implements \PHPCI\Plugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -66,8 +71,8 @@ class PhpCpd implements \PHPCI\Plugin
} }
/** /**
* Runs PHP Copy/Paste Detector in a specified directory. * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
$ignore = ''; $ignore = '';
@ -108,8 +113,11 @@ class PhpCpd implements \PHPCI\Plugin
/** /**
* Process the PHPCPD XML report. * Process the PHPCPD XML report.
*
* @param $xmlString * @param $xmlString
*
* @return array * @return array
*
* @throws \Exception * @throws \Exception
*/ */
protected function processReport($xmlString) protected function processReport($xmlString)

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,18 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* PHP CS Fixer - Works with the PHP CS Fixer for testing coding standards. * PHP CS Fixer
* @author Gabriel Baker <gabriel@autonomicpilot.co.uk> *
* @package PHPCI * Works with the PHP CS Fixer for testing coding standards.
* @subpackage Plugins *
*/ * @author Gabriel Baker <gabriel@autonomicpilot.co.uk>
class PhpCsFixer implements \PHPCI\Plugin * @package PHPCI
* @subpackage Plugins
*/
class PhpCsFixer implements PluginInterface
{ {
/** /**
* @var \PHPCI\Builder * @var \PHPCI\Builder
@ -59,8 +63,7 @@ class PhpCsFixer implements \PHPCI\Plugin
} }
/** /**
* Run PHP CS Fixer. * {@inheritDocs}
* @return bool
*/ */
public function execute() public function execute()
{ {
@ -79,6 +82,7 @@ class PhpCsFixer implements \PHPCI\Plugin
/** /**
* Build an args string for PHPCS Fixer. * Build an args string for PHPCS Fixer.
*
* @param $options * @param $options
*/ */
public function buildArgs($options) public function buildArgs($options)
@ -98,6 +102,5 @@ class PhpCsFixer implements \PHPCI\Plugin
if (isset($options['workingdir']) && $options['workingdir']) { if (isset($options['workingdir']) && $options['workingdir']) {
$this->workingdir = $this->phpci->buildPath . $options['workingdir']; $this->workingdir = $this->phpci->buildPath . $options['workingdir'];
} }
} }
} }

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,19 @@ namespace PHPCI\Plugin;
use PHPCI; use PHPCI;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
use PHPCI\PluginZeroConfigInterface;
/** /**
* PHP Docblock Checker Plugin - Checks your PHP files for appropriate uses of Docblocks * PHP Docblock Checker Plugin
* @author Dan Cryer <dan@block8.co.uk> *
* @package PHPCI * Checks your PHP files for appropriate uses of Docblocks.
* @subpackage Plugins *
*/ * @author Dan Cryer <dan@block8.co.uk>
class PhpDocblockChecker implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin * @package PHPCI
* @subpackage Plugins
*/
class PhpDocblockChecker implements PluginInterface, PluginZeroConfigInterface
{ {
/** /**
* @var \PHPCI\Builder * @var \PHPCI\Builder
@ -46,11 +51,7 @@ class PhpDocblockChecker implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
protected $skipMethods = false; protected $skipMethods = false;
/** /**
* Check if this plugin can be executed. * {@inheritDocs}
* @param $stage
* @param Builder $builder
* @param Build $build
* @return bool
*/ */
public static function canExecute($stage, Builder $builder, Build $build) public static function canExecute($stage, Builder $builder, Build $build)
{ {
@ -63,6 +64,7 @@ class PhpDocblockChecker implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -97,7 +99,7 @@ class PhpDocblockChecker implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
} }
/** /**
* Runs PHP Mess Detector in a specified directory. * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
@ -155,6 +157,7 @@ class PhpDocblockChecker implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Report all of the errors we've encountered line-by-line. * Report all of the errors we've encountered line-by-line.
*
* @param $output * @param $output
*/ */
protected function reportErrors($output) protected function reportErrors($output)

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,30 +12,30 @@ namespace PHPCI\Plugin;
use PHPCI; use PHPCI;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
use PHPCI\PluginZeroConfigInterface;
/** /**
* PHP Loc - Allows PHP Copy / Lines of Code testing. * PHP Loc - Allows PHP Copy / Lines of Code testing.
*
* @author Johan van der Heide <info@japaveh.nl> * @author Johan van der Heide <info@japaveh.nl>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
*/ */
class PhpLoc implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin class PhpLoc implements PluginInterface, PluginZeroConfigInterface
{ {
/** /**
* @var string * @var string
*/ */
protected $directory; protected $directory;
/** /**
* @var \PHPCI\Builder * @var \PHPCI\Builder
*/ */
protected $phpci; protected $phpci;
/** /**
* Check if this plugin can be executed. * {@inheritDocs}
* @param $stage
* @param Builder $builder
* @param Build $build
* @return bool
*/ */
public static function canExecute($stage, Builder $builder, Build $build) public static function canExecute($stage, Builder $builder, Build $build)
{ {
@ -48,6 +48,7 @@ class PhpLoc implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -64,7 +65,7 @@ class PhpLoc implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
} }
/** /**
* Runs PHP Copy/Paste Detector in a specified directory. * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,17 @@ namespace PHPCI\Plugin;
use PHPCI; use PHPCI;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
use PHPCI\PluginZeroConfigInterface;
/** /**
* PHP Mess Detector Plugin - Allows PHP Mess Detector testing. * PHP Mess Detector Plugin - Allows PHP Mess Detector testing.
* @author Dan Cryer <dan@block8.co.uk> *
* @package PHPCI * @author Dan Cryer <dan@block8.co.uk>
* @subpackage Plugins * @package PHPCI
*/ * @subpackage Plugins
class PhpMessDetector implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin */
class PhpMessDetector implements PluginInterface, PluginZeroConfigInterface
{ {
/** /**
* @var \PHPCI\Builder * @var \PHPCI\Builder
@ -56,11 +59,7 @@ class PhpMessDetector implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
protected $rules; protected $rules;
/** /**
* Check if this plugin can be executed. * {@inheritDocs}
* @param $stage
* @param Builder $builder
* @param Build $build
* @return bool
*/ */
public static function canExecute($stage, Builder $builder, Build $build) public static function canExecute($stage, Builder $builder, Build $build)
{ {
@ -111,7 +110,7 @@ class PhpMessDetector implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
} }
/** /**
* Runs PHP Mess Detector in a specified directory. * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
@ -132,6 +131,7 @@ class PhpMessDetector implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Override a default setting. * Override a default setting.
*
* @param $options * @param $options
* @param $key * @param $key
*/ */
@ -144,8 +144,11 @@ class PhpMessDetector implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Process PHPMD's XML output report. * Process PHPMD's XML output report.
*
* @param $xmlString * @param $xmlString
*
* @return array * @return array
*
* @throws \Exception * @throws \Exception
*/ */
protected function processReport($xmlString) protected function processReport($xmlString)
@ -186,6 +189,7 @@ class PhpMessDetector implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Try and process the rules parameter from phpci.yml. * Try and process the rules parameter from phpci.yml.
*
* @return bool * @return bool
*/ */
protected function tryAndProcessRules() protected function tryAndProcessRules()
@ -206,6 +210,7 @@ class PhpMessDetector implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Execute PHP Mess Detector. * Execute PHP Mess Detector.
*
* @param $binaryPath * @param $binaryPath
*/ */
protected function executePhpMd($binaryPath) protected function executePhpMd($binaryPath)
@ -242,6 +247,7 @@ class PhpMessDetector implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Get the path PHPMD should be run against. * Get the path PHPMD should be run against.
*
* @return string * @return string
*/ */
protected function getTargetPath() protected function getTargetPath()
@ -258,6 +264,7 @@ class PhpMessDetector implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
* Returns a boolean indicating if the error count can be considered a success. * Returns a boolean indicating if the error count can be considered a success.
* *
* @param int $errorCount * @param int $errorCount
*
* @return bool * @return bool
*/ */
protected function wasLastExecSuccessful($errorCount) protected function wasLastExecSuccessful($errorCount)

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,16 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Php Parallel Lint Plugin - Provides access to PHP lint functionality. * Php Parallel Lint Plugin - Provides access to PHP lint functionality.
* @author Vaclav Makes <vaclav@makes.cz> *
* @package PHPCI * @author Vaclav Makes <vaclav@makes.cz>
* @subpackage Plugins * @package PHPCI
*/ * @subpackage Plugins
class PhpParallelLint implements \PHPCI\Plugin */
class PhpParallelLint implements PluginInterface
{ {
/** /**
* @var \PHPCI\Builder * @var \PHPCI\Builder
@ -70,8 +72,8 @@ class PhpParallelLint implements \PHPCI\Plugin
} }
/** /**
* Executes parallel lint * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
list($ignore) = $this->getFlags(); list($ignore) = $this->getFlags();
@ -97,6 +99,7 @@ class PhpParallelLint implements \PHPCI\Plugin
/** /**
* Produce an argument string for PHP Parallel Lint. * Produce an argument string for PHP Parallel Lint.
*
* @return array * @return array
*/ */
protected function getFlags() protected function getFlags()

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,22 +12,24 @@ namespace PHPCI\Plugin;
use PHPCI; use PHPCI;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* PHP Spec Plugin - Allows PHP Spec testing. * PHP Spec Plugin - Allows PHP Spec testing.
* @author Dan Cryer <dan@block8.co.uk> *
* @package PHPCI * @author Dan Cryer <dan@block8.co.uk>
* @subpackage Plugins * @package PHPCI
*/ * @subpackage Plugins
class PhpSpec implements PHPCI\Plugin */
class PhpSpec implements PluginInterface
{ {
/** /**
* @var \PHPCI\Builder * @var Builder
*/ */
protected $phpci; protected $phpci;
/** /**
* @var \PHPCI\Model\Build * @var Build
*/ */
protected $build; protected $build;
@ -38,6 +40,7 @@ class PhpSpec implements PHPCI\Plugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -50,8 +53,8 @@ class PhpSpec implements PHPCI\Plugin
} }
/** /**
* Runs PHP Spec tests. * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
$curdir = getcwd(); $curdir = getcwd();
@ -143,7 +146,6 @@ class PhpSpec implements PHPCI\Plugin
$this->build->storeMeta('phpspec', $data); $this->build->storeMeta('phpspec', $data);
return $success; return $success;
} }
} }

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,16 @@ namespace PHPCI\Plugin;
use PHPCI; use PHPCI;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* PHPTAL Lint Plugin - Provides access to PHPTAL lint functionality. * PHPTAL Lint Plugin - Provides access to PHPTAL lint functionality.
*
* @author Stephen Ball <phpci@stephen.rebelinblue.com> * @author Stephen Ball <phpci@stephen.rebelinblue.com>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
*/ */
class PhpTalLint implements PHPCI\Plugin class PhpTalLint implements PluginInterface
{ {
protected $directories; protected $directories;
protected $recursive = true; protected $recursive = true;
@ -27,12 +29,12 @@ class PhpTalLint implements PHPCI\Plugin
protected $ignore; protected $ignore;
/** /**
* @var \PHPCI\Builder * @var Builder
*/ */
protected $phpci; protected $phpci;
/** /**
* @var \PHPCI\Model\Build * @var Build
*/ */
protected $build; protected $build;
@ -87,6 +89,7 @@ class PhpTalLint implements PHPCI\Plugin
/** /**
* Handle this plugin's options. * Handle this plugin's options.
*
* @param $options * @param $options
*/ */
protected function setOptions($options) protected function setOptions($options)
@ -99,7 +102,7 @@ class PhpTalLint implements PHPCI\Plugin
} }
/** /**
* Executes phptal lint * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
@ -143,8 +146,10 @@ class PhpTalLint implements PHPCI\Plugin
/** /**
* Lint an item (file or directory) by calling the appropriate method. * Lint an item (file or directory) by calling the appropriate method.
*
* @param $item * @param $item
* @param $itemPath * @param $itemPath
*
* @return bool * @return bool
*/ */
protected function lintItem($item, $itemPath) protected function lintItem($item, $itemPath)
@ -164,7 +169,9 @@ class PhpTalLint implements PHPCI\Plugin
/** /**
* Run phptal lint against a directory of files. * Run phptal lint against a directory of files.
*
* @param $path * @param $path
*
* @return bool * @return bool
*/ */
protected function lintDirectory($path) protected function lintDirectory($path)
@ -193,7 +200,9 @@ class PhpTalLint implements PHPCI\Plugin
/** /**
* Run phptal lint against a specific file. * Run phptal lint against a specific file.
*
* @param $path * @param $path
*
* @return bool * @return bool
*/ */
protected function lintFile($path) protected function lintFile($path)
@ -222,7 +231,7 @@ class PhpTalLint implements PHPCI\Plugin
$row = str_replace('(use -i to include your custom modifier functions)', '', $row); $row = str_replace('(use -i to include your custom modifier functions)', '', $row);
$message = str_replace($name . ': ', '', $row); $message = str_replace($name . ': ', '', $row);
$parts = explode(' (line ', $message); $parts = explode(' (line ', $message);
$message = trim($parts[0]); $message = trim($parts[0]);
@ -244,6 +253,7 @@ class PhpTalLint implements PHPCI\Plugin
/** /**
* Process options and produce an arguments string for PHPTAL Lint. * Process options and produce an arguments string for PHPTAL Lint.
*
* @return array * @return array
*/ */
protected function getFlags() protected function getFlags()

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -13,14 +13,17 @@ use PHPCI;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\Plugin\Util\TapParser; use PHPCI\Plugin\Util\TapParser;
use PHPCI\PluginInterface;
use PHPCI\PluginZeroConfigInterface;
/** /**
* PHP Unit Plugin - Allows PHP Unit testing. * PHP Unit Plugin - Allows PHP Unit testing.
* @author Dan Cryer <dan@block8.co.uk> *
* @package PHPCI * @author Dan Cryer <dan@block8.co.uk>
* @subpackage Plugins * @package PHPCI
*/ * @subpackage Plugins
class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin */
class PhpUnit implements PluginInterface, PluginZeroConfigInterface
{ {
protected $args; protected $args;
protected $phpci; protected $phpci;
@ -50,11 +53,7 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
protected $xmlConfigFile; protected $xmlConfigFile;
/** /**
* Check if this plugin can be executed. * {@inheritDocs}
* @param $stage
* @param Builder $builder
* @param Build $build
* @return bool
*/ */
public static function canExecute($stage, Builder $builder, Build $build) public static function canExecute($stage, Builder $builder, Build $build)
{ {
@ -67,7 +66,9 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Try and find the phpunit XML config file. * Try and find the phpunit XML config file.
*
* @param $buildPath * @param $buildPath
*
* @return null|string * @return null|string
*/ */
public static function findConfigFile($buildPath) public static function findConfigFile($buildPath)
@ -138,8 +139,8 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
} }
/** /**
* Runs PHP Unit tests in a specified directory, optionally using specified config file(s). * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
if (empty($this->xmlConfigFile) && empty($this->directory)) { if (empty($this->xmlConfigFile) && empty($this->directory)) {
@ -184,7 +185,9 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Run the tests defined in a PHPUnit config file. * Run the tests defined in a PHPUnit config file.
*
* @param $configPath * @param $configPath
*
* @return bool|mixed * @return bool|mixed
*/ */
protected function runConfigFile($configPath) protected function runConfigFile($configPath)
@ -212,7 +215,9 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Run the PHPUnit tests in a specific directory or array of directories. * Run the PHPUnit tests in a specific directory or array of directories.
*
* @param $directory * @param $directory
*
* @return bool|mixed * @return bool|mixed
*/ */
protected function runDir($directory) protected function runDir($directory)
@ -235,6 +240,7 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* @param $array * @param $array
* @param $callable * @param $callable
*
* @return bool|mixed * @return bool|mixed
*/ */
protected function recurseArg($array, $callable) protected function recurseArg($array, $callable)

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,16 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Helper\Lang; use PHPCI\Helper\Lang;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Shell Plugin - Allows execute shell commands. * Shell Plugin - Allows execute shell commands.
*
* @author Kinn Coelho Julião <kinncj@gmail.com> * @author Kinn Coelho Julião <kinncj@gmail.com>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
*/ */
class Shell implements \PHPCI\Plugin class Shell implements PluginInterface
{ {
/** /**
* @var \PHPCI\Builder * @var \PHPCI\Builder
@ -75,7 +77,7 @@ class Shell implements \PHPCI\Plugin
} }
/** /**
* Runs the shell command. * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {

View file

@ -1,7 +1,8 @@
<?php <?php
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* @copyright Copyright 2014, Block 8 Limited. *
* @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -10,14 +11,16 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Slack Plugin * Slack Plugin
*
* @author Stephen Ball <phpci@stephen.rebelinblue.com> * @author Stephen Ball <phpci@stephen.rebelinblue.com>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
*/ */
class SlackNotify implements \PHPCI\Plugin class SlackNotify implements PluginInterface
{ {
private $webHook; private $webHook;
private $room; private $room;
@ -69,8 +72,7 @@ class SlackNotify implements \PHPCI\Plugin
} }
/** /**
* Run the Slack plugin. * {@inheritDocs}
* @return bool
*/ */
public function execute() public function execute()
{ {

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,14 +12,16 @@ namespace PHPCI\Plugin;
use PDO; use PDO;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* SQLite Plugin Provides access to a SQLite database. * SQLite Plugin Provides access to a SQLite database.
* @author Corpsee <poisoncorpsee@gmail.com> *
* @package PHPCI * @author Corpsee <poisoncorpsee@gmail.com>
* @subpackage Plugins * @package PHPCI
*/ * @subpackage Plugins
class Sqlite implements \PHPCI\Plugin */
class Sqlite implements PluginInterface
{ {
/** /**
* @var \PHPCI\Builder * @var \PHPCI\Builder
@ -60,8 +62,7 @@ class Sqlite implements \PHPCI\Plugin
} }
/** /**
* Connects to SQLite and runs a specified set of queries. * {@inheritDocs}
* @return boolean
*/ */
public function execute() public function execute()
{ {

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -12,15 +12,17 @@ namespace PHPCI\Plugin;
use PHPCI; use PHPCI;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
use PHPCI\PluginZeroConfigInterface;
/** /**
* Technical Debt Plugin - Checks for existence of "TODO", "FIXME", etc. * Technical Debt Plugin - Checks for existence of "TODO", "FIXME", etc.
* *
* @author James Inman <james@jamesinman.co.uk> * @author James Inman <james@jamesinman.co.uk>
* @package PHPCI * @package PHPCI
* @subpackage Plugins * @subpackage Plugins
*/ */
class TechnicalDebt implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin class TechnicalDebt implements PluginInterface, PluginZeroConfigInterface
{ {
/** /**
* @var \PHPCI\Builder * @var \PHPCI\Builder
@ -65,12 +67,7 @@ class TechnicalDebt implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Check if this plugin can be executed. * {@inheritDocs}
*
* @param $stage
* @param Builder $builder
* @param Build $build
* @return bool
*/ */
public static function canExecute($stage, Builder $builder, Build $build) public static function canExecute($stage, Builder $builder, Build $build)
{ {
@ -110,6 +107,7 @@ class TechnicalDebt implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
/** /**
* Handle this plugin's options. * Handle this plugin's options.
*
* @param $options * @param $options
*/ */
protected function setOptions($options) protected function setOptions($options)
@ -122,8 +120,8 @@ class TechnicalDebt implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
} }
/** /**
* Runs the plugin * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
$success = true; $success = true;

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -11,14 +11,16 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* Wipe Plugin - Wipes a folder * Wipe Plugin - Wipes a folder
* @author Claus Due <claus@namelesscoder.net> *
* @package PHPCI * @author Claus Due <claus@namelesscoder.net>
* @subpackage Plugins * @package PHPCI
*/ * @subpackage Plugins
class Wipe implements \PHPCI\Plugin */
class Wipe implements PluginInterface
{ {
/** /**
* @var \PHPCI\Builder * @var \PHPCI\Builder
@ -34,6 +36,7 @@ class Wipe implements \PHPCI\Plugin
/** /**
* Set up the plugin, configure options, etc. * Set up the plugin, configure options, etc.
*
* @param Builder $phpci * @param Builder $phpci
* @param Build $build * @param Build $build
* @param array $options * @param array $options
@ -47,8 +50,8 @@ class Wipe implements \PHPCI\Plugin
} }
/** /**
* Wipes a directory's contents * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
$build = $this->phpci->buildPath; $build = $this->phpci->buildPath;

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -11,14 +11,16 @@ namespace PHPCI\Plugin;
use PHPCI\Builder; use PHPCI\Builder;
use PHPCI\Model\Build; use PHPCI\Model\Build;
use PHPCI\PluginInterface;
/** /**
* XMPP Notification - Send notification for successful or failure build * XMPP Notification - Send notification for successful or failure build
* @author Alexandre Russo <dev.github@ange7.com> *
* @package PHPCI * @author Alexandre Russo <dev.github@ange7.com>
* @subpackage Plugins * @package PHPCI
*/ * @subpackage Plugins
class XMPP implements \PHPCI\Plugin */
class XMPP implements PluginInterface
{ {
protected $directory; protected $directory;
protected $phpci; protected $phpci;
@ -129,6 +131,8 @@ class XMPP implements \PHPCI\Plugin
/** /**
* Find config file for sendxmpp binary (default is .sendxmpprc) * Find config file for sendxmpp binary (default is .sendxmpprc)
*
* @return bool|null
*/ */
public function findConfigFile() public function findConfigFile()
{ {
@ -144,8 +148,8 @@ class XMPP implements \PHPCI\Plugin
} }
/** /**
* Send notification message. * {@inheritDocs}
*/ */
public function execute() public function execute()
{ {
$sendxmpp = $this->phpci->findBinary('sendxmpp'); $sendxmpp = $this->phpci->findBinary('sendxmpp');
@ -199,6 +203,7 @@ class XMPP implements \PHPCI\Plugin
/** /**
* @param $message_file * @param $message_file
*
* @return int * @return int
*/ */
protected function buildMessage($message_file) protected function buildMessage($message_file)

32
PHPCI/PluginInterface.php Normal file
View file

@ -0,0 +1,32 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI;
use PHPCI\Plugin\Exception\PluginException;
use PHPCI\Plugin\Exception\PluginBinaryNotFoundException;
/**
* PHPCI Plugin Interface
*
* Interface used by all build plugins.
*
* @author Dan Cryer <dan@block8.co.uk>
*/
interface PluginInterface
{
/**
* Exeucte the plugin and return the execution success result.
*
* @return bool Plugin execution status result.
* @throws PluginException
* @throws PluginBinaryNotFoundException
*/
public function execute();
}

View file

@ -0,0 +1,30 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI;
use PHPCI\Model\Build;
/**
* PHPCI Plugin Interface - Used by all build plugins.
*
* @author Dan Cryer <dan@block8.co.uk>
*/
interface PluginZeroConfigInterface
{
/**
* Check if this plugin can be executed.
*
* @param string $stage The current stage
* @param Builder $builder The plugin builder
* @param Build $build The current build
* @return bool Plugin execution result status.
*/
public static function canExecute($stage, Builder $builder, Build $build);
}

View file

@ -2,7 +2,7 @@
/** /**
* PHPCI - Continuous Integration for PHP * PHPCI - Continuous Integration for PHP
* *
* @copyright Copyright 2014, Block 8 Limited. * @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/ * @link https://www.phptesting.org/
*/ */
@ -13,9 +13,12 @@ use PHPCI\Model\Build;
/** /**
* PHPCI Plugin Interface - Used by all build plugins. * PHPCI Plugin Interface - Used by all build plugins.
* @author Dan Cryer <dan@block8.co.uk> *
* @author Dan Cryer <dan@block8.co.uk>
* @deprecated 1.8 Only for backward compatibility
* @see PluginZeroConfigInterface
*/ */
interface ZeroConfigPlugin interface ZeroConfigPlugin extends PluginZeroConfigInterface
{ {
public static function canExecute($stage, Builder $builder, Build $build);
} }