diff --git a/PHPCI/Plugin.php b/PHPCI/Plugin.php index ac2960cd..6627463e 100644 --- a/PHPCI/Plugin.php +++ b/PHPCI/Plugin.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -10,10 +10,13 @@ namespace PHPCI; /** -* PHPCI Plugin Interface - Used by all build plugins. -* @author Dan Cryer -*/ -interface Plugin + * PHPCI Plugin Interface - Used by all build plugins. + * + * @author Dan Cryer + * @deprecated 1.8 Only for backward compatibility + * @see PluginInterface + */ +interface Plugin extends PluginInterface { - public function execute(); + } diff --git a/PHPCI/Plugin/Atoum.php b/PHPCI/Plugin/Atoum.php index 877f009b..5eb3b343 100644 --- a/PHPCI/Plugin/Atoum.php +++ b/PHPCI/Plugin/Atoum.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,12 +12,20 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Helper\Lang; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** - * Atoum plugin, runs Atoum tests within a project. - * @package PHPCI\Plugin + * Atoum plugin + * + * Runs Atoum tests within a project. + * + * @author Sanpi + * @author André Cianfarani + * @author Dan Cryer + * @package PHPCI + * @subpackage Plugins */ -class Atoum implements \PHPCI\Plugin +class Atoum implements PluginInterface { private $args; private $config; @@ -84,7 +92,7 @@ class Atoum implements \PHPCI\Plugin $status = false; $this->phpci->log(Lang::get('no_tests_performed')); } - + return $status; } } diff --git a/PHPCI/Plugin/Behat.php b/PHPCI/Plugin/Behat.php index 445d7191..4a336a40 100644 --- a/PHPCI/Plugin/Behat.php +++ b/PHPCI/Plugin/Behat.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,16 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Helper\Lang; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** * Behat BDD Plugin + * * @author Dan Cryer * @package PHPCI * @subpackage Plugins */ -class Behat implements \PHPCI\Plugin +class Behat implements PluginInterface { protected $phpci; protected $build; diff --git a/PHPCI/Plugin/Campfire.php b/PHPCI/Plugin/Campfire.php index 325e6e40..d61954ab 100644 --- a/PHPCI/Plugin/Campfire.php +++ b/PHPCI/Plugin/Campfire.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,15 +12,18 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Helper\Lang; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** - * Campfire Plugin - Allows Campfire API actions. - * strongly based on icecube (http://labs.mimmin.com/icecube) + * Campfire Plugin + * + * Allows Campfire API actions, strongly based on icecube (http://labs.mimmin.com/icecube) + * * @author André Cianfarani * @package PHPCI * @subpackage Plugins */ -class Campfire implements \PHPCI\Plugin +class Campfire implements PluginInterface { private $url; private $authToken; diff --git a/PHPCI/Plugin/CleanBuild.php b/PHPCI/Plugin/CleanBuild.php index 2d33aee4..9757d914 100644 --- a/PHPCI/Plugin/CleanBuild.php +++ b/PHPCI/Plugin/CleanBuild.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -11,15 +11,19 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** -* Clean build removes Composer related files and allows PHPCI users to clean up their build directory. -* Useful as a precursor to copy_build. -* @author Dan Cryer -* @package PHPCI -* @subpackage Plugins -*/ -class CleanBuild implements \PHPCI\Plugin + * Clean build Plugin + * + * Removes Composer related files and allows PHPCI users to clean up their build + * directory. Useful as a precursor to copy_build. + * + * @author Dan Cryer + * @package PHPCI + * @subpackage Plugins + */ +class CleanBuild implements PluginInterface { protected $remove; protected $phpci; @@ -57,7 +61,7 @@ class CleanBuild implements \PHPCI\Plugin $this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.lock'); $success = true; - + foreach ($this->remove as $file) { $ok = $this->phpci->executeCommand($cmd, $this->phpci->buildPath . $file); diff --git a/PHPCI/Plugin/Codeception.php b/PHPCI/Plugin/Codeception.php index fe12db76..ba9d56fb 100644 --- a/PHPCI/Plugin/Codeception.php +++ b/PHPCI/Plugin/Codeception.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -14,16 +14,21 @@ use PHPCI\Helper\Lang; use PHPCI\Model\Build; use PHPCI\Plugin\Util\TestResultParsers\Codeception as Parser; 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 * @author Igor Timoshenko * @author Adam Cooper * @package PHPCI * @subpackage Plugins */ -class Codeception implements \PHPCI\Plugin, \PHPCI\ZeroConfigPlugin +class Codeception implements PluginInterface, PluginZeroConfigInterface { /** @var string */ protected $args = ''; diff --git a/PHPCI/Plugin/Composer.php b/PHPCI/Plugin/Composer.php index 87a558fe..7302fe42 100644 --- a/PHPCI/Plugin/Composer.php +++ b/PHPCI/Plugin/Composer.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -13,14 +13,19 @@ use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; use PHPCI\Helper\Lang; +use PHPCI\PluginInterface; +use PHPCI\PluginZeroConfigInterface; /** -* Composer Plugin - Provides access to Composer functionality. -* @author Dan Cryer -* @package PHPCI -* @subpackage Plugins -*/ -class Composer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin + * Composer Plugin + * + * Provides access to Composer functionality. + * + * @author Dan Cryer + * @package PHPCI + * @subpackage Plugins + */ +class Composer implements PluginInterface, PluginZeroConfigInterface { protected $directory; protected $action; diff --git a/PHPCI/Plugin/CopyBuild.php b/PHPCI/Plugin/CopyBuild.php index 7f447291..0a7d301b 100644 --- a/PHPCI/Plugin/CopyBuild.php +++ b/PHPCI/Plugin/CopyBuild.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,18 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Model\Build; use PHPCI\Helper\Lang; +use PHPCI\PluginInterface; /** -* Copy Build Plugin - Copies the entire build to another directory. -* @author Dan Cryer -* @package PHPCI -* @subpackage Plugins -*/ -class CopyBuild implements \PHPCI\Plugin + * Copy Build Plugin + * + * Copies the entire build to another directory. + * + * @author Dan Cryer + * @package PHPCI + * @subpackage Plugins + */ +class CopyBuild implements PluginInterface { protected $directory; protected $ignore; diff --git a/PHPCI/Plugin/Email.php b/PHPCI/Plugin/Email.php index 8414451f..b1c430d0 100644 --- a/PHPCI/Plugin/Email.php +++ b/PHPCI/Plugin/Email.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -14,14 +14,18 @@ use PHPCI\Builder; use PHPCI\Helper\Lang; use PHPCI\Model\Build; use PHPCI\Helper\Email as EmailHelper; +use PHPCI\PluginInterface; /** -* Email Plugin - Provides simple email capability to PHPCI. -* @author Steve Brazier -* @package PHPCI -* @subpackage Plugins -*/ -class Email implements \PHPCI\Plugin + * Email Plugin + * + * Provides simple email capability to PHPCI. + * + * @author Steve Brazier + * @package PHPCI + * @subpackage Plugins + */ +class Email implements PluginInterface { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/Env.php b/PHPCI/Plugin/Env.php index 4e4b6563..8d7eac06 100644 --- a/PHPCI/Plugin/Env.php +++ b/PHPCI/Plugin/Env.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,16 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Helper\Lang; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** -* Environment variable plugin -* @author Steve Kamerman -* @package PHPCI -* @subpackage Plugins -*/ -class Env implements \PHPCI\Plugin + * Environment variable plugin + * + * @author Steve Kamerman + * @package PHPCI + * @subpackage Plugins + */ +class Env implements PluginInterface { protected $phpci; protected $build; @@ -52,7 +54,7 @@ class Env implements \PHPCI\Plugin // This allows the standard syntax: "FOO: bar" $env_var = "$key=$value"; } - + if (!putenv($this->phpci->interpolate($env_var))) { $success = false; $this->phpci->logFailure(Lang::get('unable_to_set_env')); diff --git a/PHPCI/Plugin/Exception/PluginBinaryNotFoundException.php b/PHPCI/Plugin/Exception/PluginBinaryNotFoundException.php new file mode 100644 index 00000000..2d8bd56a --- /dev/null +++ b/PHPCI/Plugin/Exception/PluginBinaryNotFoundException.php @@ -0,0 +1,17 @@ + * @package PHPCI * @subpackage Plugins */ -class Git implements \PHPCI\Plugin +class Git implements PluginInterface { protected $phpci; protected $build; diff --git a/PHPCI/Plugin/Grunt.php b/PHPCI/Plugin/Grunt.php index 1ad0ceec..c79b2e23 100644 --- a/PHPCI/Plugin/Grunt.php +++ b/PHPCI/Plugin/Grunt.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -11,14 +11,18 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** -* Grunt Plugin - Provides access to grunt functionality. -* @author Tobias Tom -* @package PHPCI -* @subpackage Plugins -*/ -class Grunt implements \PHPCI\Plugin + * Grunt Plugin + * + * Provides access to grunt functionality. + * + * @author Tobias Tom + * @package PHPCI + * @subpackage Plugins + */ +class Grunt implements PluginInterface { protected $directory; protected $task; diff --git a/PHPCI/Plugin/Gulp.php b/PHPCI/Plugin/Gulp.php index 97ad9246..111a3600 100644 --- a/PHPCI/Plugin/Gulp.php +++ b/PHPCI/Plugin/Gulp.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -11,14 +11,18 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** -* Gulp Plugin - Provides access to gulp functionality. -* @author Dirk Heilig -* @package PHPCI -* @subpackage Plugins -*/ -class Gulp implements \PHPCI\Plugin + * Gulp Plugin + * + * Provides access to gulp functionality. + * + * @author Dirk Heilig + * @package PHPCI + * @subpackage Plugins + */ +class Gulp implements PluginInterface { protected $directory; protected $task; diff --git a/PHPCI/Plugin/HipchatNotify.php b/PHPCI/Plugin/HipchatNotify.php index a39b94fe..0bafbfa7 100644 --- a/PHPCI/Plugin/HipchatNotify.php +++ b/PHPCI/Plugin/HipchatNotify.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,18 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Helper\Lang; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** - * Hipchat Plugin + * Hipchat Plugin. + * + * Send build notification in HipChat. + * * @author James Inman * @package PHPCI * @subpackage Plugins */ -class HipchatNotify implements \PHPCI\Plugin +class HipchatNotify implements PluginInterface { protected $authToken; protected $color; diff --git a/PHPCI/Plugin/Irc.php b/PHPCI/Plugin/Irc.php index a7610a8c..3c15becc 100644 --- a/PHPCI/Plugin/Irc.php +++ b/PHPCI/Plugin/Irc.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,18 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Helper\Lang; 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 * @package PHPCI * @subpackage Plugins */ -class Irc implements \PHPCI\Plugin +class Irc implements PluginInterface { protected $phpci; protected $build; diff --git a/PHPCI/Plugin/Lint.php b/PHPCI/Plugin/Lint.php index 90436d70..2f6fc8e7 100644 --- a/PHPCI/Plugin/Lint.php +++ b/PHPCI/Plugin/Lint.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,18 @@ namespace PHPCI\Plugin; use PHPCI; use PHPCI\Builder; 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 * @package PHPCI * @subpackage Plugins */ -class Lint implements PHPCI\Plugin +class Lint implements PluginInterface { protected $directories; protected $recursive = true; diff --git a/PHPCI/Plugin/Mysql.php b/PHPCI/Plugin/Mysql.php index 5c36a09f..ab975a36 100644 --- a/PHPCI/Plugin/Mysql.php +++ b/PHPCI/Plugin/Mysql.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -13,15 +13,19 @@ use PDO; use PHPCI\Builder; use PHPCI\Helper\Lang; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** -* MySQL Plugin - Provides access to a MySQL database. -* @author Dan Cryer -* @author Steve Kamerman -* @package PHPCI -* @subpackage Plugins -*/ -class Mysql implements \PHPCI\Plugin + * MySQL Plugin + * + * Provides access to a MySQL database. + * + * @author Dan Cryer + * @author Steve Kamerman + * @package PHPCI + * @subpackage Plugins + */ +class Mysql implements PluginInterface { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/PackageBuild.php b/PHPCI/Plugin/PackageBuild.php index 8e40c71f..6c2ccda8 100644 --- a/PHPCI/Plugin/PackageBuild.php +++ b/PHPCI/Plugin/PackageBuild.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -11,14 +11,16 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** -* Create a ZIP or TAR.GZ archive of the entire build. -* @author Dan Cryer -* @package PHPCI -* @subpackage Plugins -*/ -class PackageBuild implements \PHPCI\Plugin + * Create a ZIP or TAR.GZ archive of the entire build. + * + * @author Dan Cryer + * @package PHPCI + * @subpackage Plugins + */ +class PackageBuild implements PluginInterface { protected $directory; protected $filename; diff --git a/PHPCI/Plugin/Pdepend.php b/PHPCI/Plugin/Pdepend.php index 73b669c1..e7d42dff 100644 --- a/PHPCI/Plugin/Pdepend.php +++ b/PHPCI/Plugin/Pdepend.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,18 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Helper\Lang; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** - * Pdepend Plugin - Allows Pdepend report + * Pdepend Plugin + * + * Allows Pdepend report + * * @author Johan van der Heide * @package PHPCI * @subpackage Plugins */ -class Pdepend implements \PHPCI\Plugin +class Pdepend implements PluginInterface { protected $args; /** diff --git a/PHPCI/Plugin/Pgsql.php b/PHPCI/Plugin/Pgsql.php index 9d0f924d..a2999bfd 100644 --- a/PHPCI/Plugin/Pgsql.php +++ b/PHPCI/Plugin/Pgsql.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,18 @@ namespace PHPCI\Plugin; use PDO; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** -* PgSQL Plugin - Provides access to a PgSQL database. -* @author Dan Cryer -* @package PHPCI -* @subpackage Plugins -*/ -class Pgsql implements \PHPCI\Plugin + * PgSQL Plugin + * + * Provides access to a PgSQL database. + * + * @author Dan Cryer + * @package PHPCI + * @subpackage Plugins + */ +class Pgsql implements PluginInterface { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/Phar.php b/PHPCI/Plugin/Phar.php index 0500fddc..26ec5834 100644 --- a/PHPCI/Plugin/Phar.php +++ b/PHPCI/Plugin/Phar.php @@ -1,16 +1,31 @@ + * @package PHPCI + * @subpackage Plugins */ -class Phar implements \PHPCI\Plugin +class Phar implements PluginInterface { /** * PHPCI diff --git a/PHPCI/Plugin/Phing.php b/PHPCI/Plugin/Phing.php index 3a5bd834..206159e0 100644 --- a/PHPCI/Plugin/Phing.php +++ b/PHPCI/Plugin/Phing.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,15 +12,18 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Helper\Lang; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** - * Phing Plugin - Provides access to Phing functionality. + * Phing Plugin + * + * Provides access to Phing functionality. * * @author Pavel Pavlov * @package PHPCI * @subpackage Plugins */ -class Phing implements \PHPCI\Plugin +class Phing implements PluginInterface { private $directory; diff --git a/PHPCI/Plugin/PhpCodeSniffer.php b/PHPCI/Plugin/PhpCodeSniffer.php index 877d24c6..7f3c959b 100644 --- a/PHPCI/Plugin/PhpCodeSniffer.php +++ b/PHPCI/Plugin/PhpCodeSniffer.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,19 @@ namespace PHPCI\Plugin; use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; +use PHPCI\PluginZeroConfigInterface; /** -* PHP Code Sniffer Plugin - Allows PHP Code Sniffer testing. -* @author Dan Cryer -* @package PHPCI -* @subpackage Plugins -*/ -class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin + * PHP Code Sniffer Plugin + * + * Allows PHP Code Sniffer testing. + * + * @author Dan Cryer + * @package PHPCI + * @subpackage Plugins + */ +class PhpCodeSniffer implements PluginInterface, PluginZeroConfigInterface { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/PhpCpd.php b/PHPCI/Plugin/PhpCpd.php index 6433308f..0a54a7a7 100644 --- a/PHPCI/Plugin/PhpCpd.php +++ b/PHPCI/Plugin/PhpCpd.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,18 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Helper\Lang; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** -* PHP Copy / Paste Detector - Allows PHP Copy / Paste Detector testing. -* @author Dan Cryer -* @package PHPCI -* @subpackage Plugins -*/ -class PhpCpd implements \PHPCI\Plugin + * PHP Copy / Paste Detector. + * + * Allows PHP Copy / Paste Detector testing. + * + * @author Dan Cryer + * @package PHPCI + * @subpackage Plugins + */ +class PhpCpd implements PluginInterface { protected $directory; protected $args; diff --git a/PHPCI/Plugin/PhpCsFixer.php b/PHPCI/Plugin/PhpCsFixer.php index e07db718..bc82e199 100644 --- a/PHPCI/Plugin/PhpCsFixer.php +++ b/PHPCI/Plugin/PhpCsFixer.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,18 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Helper\Lang; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** -* PHP CS Fixer - Works with the PHP CS Fixer for testing coding standards. -* @author Gabriel Baker -* @package PHPCI -* @subpackage Plugins -*/ -class PhpCsFixer implements \PHPCI\Plugin + * PHP CS Fixer + * + * Works with the PHP CS Fixer for testing coding standards. + * + * @author Gabriel Baker + * @package PHPCI + * @subpackage Plugins + */ +class PhpCsFixer implements PluginInterface { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/PhpDocblockChecker.php b/PHPCI/Plugin/PhpDocblockChecker.php index 7fb0fe11..0eb9629e 100644 --- a/PHPCI/Plugin/PhpDocblockChecker.php +++ b/PHPCI/Plugin/PhpDocblockChecker.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,19 @@ namespace PHPCI\Plugin; use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; +use PHPCI\PluginZeroConfigInterface; /** -* PHP Docblock Checker Plugin - Checks your PHP files for appropriate uses of Docblocks -* @author Dan Cryer -* @package PHPCI -* @subpackage Plugins -*/ -class PhpDocblockChecker implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin + * PHP Docblock Checker Plugin + * + * Checks your PHP files for appropriate uses of Docblocks. + * + * @author Dan Cryer + * @package PHPCI + * @subpackage Plugins + */ +class PhpDocblockChecker implements PluginInterface, PluginZeroConfigInterface { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/PhpLoc.php b/PHPCI/Plugin/PhpLoc.php index 76887493..ae76f53c 100644 --- a/PHPCI/Plugin/PhpLoc.php +++ b/PHPCI/Plugin/PhpLoc.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,17 @@ namespace PHPCI\Plugin; use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; +use PHPCI\PluginZeroConfigInterface; /** * PHP Loc - Allows PHP Copy / Lines of Code testing. + * * @author Johan van der Heide * @package PHPCI * @subpackage Plugins */ -class PhpLoc implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin +class PhpLoc implements PluginInterface, PluginZeroConfigInterface { /** * @var string diff --git a/PHPCI/Plugin/PhpMessDetector.php b/PHPCI/Plugin/PhpMessDetector.php index b02f5f09..199a65e1 100644 --- a/PHPCI/Plugin/PhpMessDetector.php +++ b/PHPCI/Plugin/PhpMessDetector.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,17 @@ namespace PHPCI\Plugin; use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; +use PHPCI\PluginZeroConfigInterface; /** -* PHP Mess Detector Plugin - Allows PHP Mess Detector testing. -* @author Dan Cryer -* @package PHPCI -* @subpackage Plugins -*/ -class PhpMessDetector implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin + * PHP Mess Detector Plugin - Allows PHP Mess Detector testing. + * + * @author Dan Cryer + * @package PHPCI + * @subpackage Plugins + */ +class PhpMessDetector implements PluginInterface, PluginZeroConfigInterface { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/PhpParallelLint.php b/PHPCI/Plugin/PhpParallelLint.php index 8b7528de..3cda9e74 100644 --- a/PHPCI/Plugin/PhpParallelLint.php +++ b/PHPCI/Plugin/PhpParallelLint.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,16 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Helper\Lang; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** -* Php Parallel Lint Plugin - Provides access to PHP lint functionality. -* @author Vaclav Makes -* @package PHPCI -* @subpackage Plugins -*/ -class PhpParallelLint implements \PHPCI\Plugin + * Php Parallel Lint Plugin - Provides access to PHP lint functionality. + * + * @author Vaclav Makes + * @package PHPCI + * @subpackage Plugins + */ +class PhpParallelLint implements PluginInterface { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/PhpSpec.php b/PHPCI/Plugin/PhpSpec.php index e468a718..70840185 100644 --- a/PHPCI/Plugin/PhpSpec.php +++ b/PHPCI/Plugin/PhpSpec.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,16 @@ namespace PHPCI\Plugin; use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** -* PHP Spec Plugin - Allows PHP Spec testing. -* @author Dan Cryer -* @package PHPCI -* @subpackage Plugins -*/ -class PhpSpec implements PHPCI\Plugin + * PHP Spec Plugin - Allows PHP Spec testing. + * + * @author Dan Cryer + * @package PHPCI + * @subpackage Plugins + */ +class PhpSpec implements PluginInterface { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/PhpTalLint.php b/PHPCI/Plugin/PhpTalLint.php index e12b6c34..95469881 100644 --- a/PHPCI/Plugin/PhpTalLint.php +++ b/PHPCI/Plugin/PhpTalLint.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,16 @@ namespace PHPCI\Plugin; use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** * PHPTAL Lint Plugin - Provides access to PHPTAL lint functionality. + * * @author Stephen Ball * @package PHPCI * @subpackage Plugins */ -class PhpTalLint implements PHPCI\Plugin +class PhpTalLint implements PluginInterface { protected $directories; protected $recursive = true; @@ -222,7 +224,7 @@ class PhpTalLint implements PHPCI\Plugin $row = str_replace('(use -i to include your custom modifier functions)', '', $row); $message = str_replace($name . ': ', '', $row); - + $parts = explode(' (line ', $message); $message = trim($parts[0]); diff --git a/PHPCI/Plugin/PhpUnit.php b/PHPCI/Plugin/PhpUnit.php index 7fb626df..f6dcf50a 100644 --- a/PHPCI/Plugin/PhpUnit.php +++ b/PHPCI/Plugin/PhpUnit.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -13,14 +13,17 @@ use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; use PHPCI\Plugin\Util\TapParser; +use PHPCI\PluginInterface; +use PHPCI\PluginZeroConfigInterface; /** -* PHP Unit Plugin - Allows PHP Unit testing. -* @author Dan Cryer -* @package PHPCI -* @subpackage Plugins -*/ -class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin + * PHP Unit Plugin - Allows PHP Unit testing. + * + * @author Dan Cryer + * @package PHPCI + * @subpackage Plugins + */ +class PhpUnit implements PluginInterface, PluginZeroConfigInterface { protected $args; protected $phpci; diff --git a/PHPCI/Plugin/Shell.php b/PHPCI/Plugin/Shell.php index 5e914f3e..1b1012f1 100644 --- a/PHPCI/Plugin/Shell.php +++ b/PHPCI/Plugin/Shell.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,16 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Helper\Lang; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** * Shell Plugin - Allows execute shell commands. + * * @author Kinn Coelho Julião * @package PHPCI * @subpackage Plugins */ -class Shell implements \PHPCI\Plugin +class Shell implements PluginInterface { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/SlackNotify.php b/PHPCI/Plugin/SlackNotify.php index 65a190fd..03c5296b 100644 --- a/PHPCI/Plugin/SlackNotify.php +++ b/PHPCI/Plugin/SlackNotify.php @@ -1,7 +1,8 @@ * @package PHPCI * @subpackage Plugins */ -class SlackNotify implements \PHPCI\Plugin +class SlackNotify implements PluginInterface { private $webHook; private $room; diff --git a/PHPCI/Plugin/Sqlite.php b/PHPCI/Plugin/Sqlite.php index f80ece3d..7f8fadf2 100644 --- a/PHPCI/Plugin/Sqlite.php +++ b/PHPCI/Plugin/Sqlite.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,14 +12,16 @@ namespace PHPCI\Plugin; use PDO; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** -* SQLite Plugin — Provides access to a SQLite database. -* @author Corpsee -* @package PHPCI -* @subpackage Plugins -*/ -class Sqlite implements \PHPCI\Plugin + * SQLite Plugin — Provides access to a SQLite database. + * + * @author Corpsee + * @package PHPCI + * @subpackage Plugins + */ +class Sqlite implements PluginInterface { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/TechnicalDebt.php b/PHPCI/Plugin/TechnicalDebt.php index eca05213..0cd1d945 100755 --- a/PHPCI/Plugin/TechnicalDebt.php +++ b/PHPCI/Plugin/TechnicalDebt.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -12,15 +12,17 @@ namespace PHPCI\Plugin; use PHPCI; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; +use PHPCI\PluginZeroConfigInterface; /** -* Technical Debt Plugin - Checks for existence of "TODO", "FIXME", etc. -* -* @author James Inman -* @package PHPCI -* @subpackage Plugins -*/ -class TechnicalDebt implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin + * Technical Debt Plugin - Checks for existence of "TODO", "FIXME", etc. + * + * @author James Inman + * @package PHPCI + * @subpackage Plugins + */ +class TechnicalDebt implements PluginInterface, PluginZeroConfigInterface { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/Wipe.php b/PHPCI/Plugin/Wipe.php index 86e543b5..a4151573 100644 --- a/PHPCI/Plugin/Wipe.php +++ b/PHPCI/Plugin/Wipe.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -11,14 +11,16 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** -* Wipe Plugin - Wipes a folder -* @author Claus Due -* @package PHPCI -* @subpackage Plugins -*/ -class Wipe implements \PHPCI\Plugin + * Wipe Plugin - Wipes a folder + * + * @author Claus Due + * @package PHPCI + * @subpackage Plugins + */ +class Wipe implements PluginInterface { /** * @var \PHPCI\Builder diff --git a/PHPCI/Plugin/Xmpp.php b/PHPCI/Plugin/Xmpp.php index 0362aa85..126f72bf 100644 --- a/PHPCI/Plugin/Xmpp.php +++ b/PHPCI/Plugin/Xmpp.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -11,14 +11,16 @@ namespace PHPCI\Plugin; use PHPCI\Builder; use PHPCI\Model\Build; +use PHPCI\PluginInterface; /** -* XMPP Notification - Send notification for successful or failure build -* @author Alexandre Russo -* @package PHPCI -* @subpackage Plugins -*/ -class XMPP implements \PHPCI\Plugin + * XMPP Notification - Send notification for successful or failure build + * + * @author Alexandre Russo + * @package PHPCI + * @subpackage Plugins + */ +class XMPP implements PluginInterface { protected $directory; protected $phpci; diff --git a/PHPCI/PluginInterface.php b/PHPCI/PluginInterface.php new file mode 100644 index 00000000..2368545b --- /dev/null +++ b/PHPCI/PluginInterface.php @@ -0,0 +1,32 @@ + + */ +interface PluginInterface +{ + /** + * Exeucte the plugin and return the execution success result. + * + * @return bool Plugin execution status result. + * @throws PluginException + * @throws PluginBinaryNotFoundException + */ + public function execute(); +} diff --git a/PHPCI/PluginZeroConfigInterface.php b/PHPCI/PluginZeroConfigInterface.php new file mode 100644 index 00000000..b7ccf10f --- /dev/null +++ b/PHPCI/PluginZeroConfigInterface.php @@ -0,0 +1,30 @@ + + */ +interface PluginZeroConfigInterface +{ + /** + * Execute the plugin withput requiring configuration. + * + * @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); +} diff --git a/PHPCI/ZeroConfigPlugin.php b/PHPCI/ZeroConfigPlugin.php index 73f7746c..410ee37e 100644 --- a/PHPCI/ZeroConfigPlugin.php +++ b/PHPCI/ZeroConfigPlugin.php @@ -2,7 +2,7 @@ /** * 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 * @link https://www.phptesting.org/ */ @@ -13,9 +13,12 @@ use PHPCI\Model\Build; /** * PHPCI Plugin Interface - Used by all build plugins. - * @author Dan Cryer + * + * @author Dan Cryer + * @deprecated 1.8 Only for backward compatibility + * @see PluginZeroConfigInterface */ -interface ZeroConfigPlugin +interface ZeroConfigPlugin extends PluginZeroConfigInterface { - public static function canExecute($stage, Builder $builder, Build $build); + }