2013-05-03 17:02:53 +02:00
|
|
|
<?php
|
2013-05-16 03:16:56 +02:00
|
|
|
/**
|
2014-05-12 18:26:17 +02:00
|
|
|
* PHPCI - Continuous Integration for PHP
|
|
|
|
*
|
|
|
|
* @copyright Copyright 2014, Block 8 Limited.
|
|
|
|
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
|
|
|
* @link https://www.phptesting.org/
|
|
|
|
*/
|
2013-05-03 17:02:53 +02:00
|
|
|
|
2016-07-19 20:28:11 +02:00
|
|
|
namespace PHPCensor;
|
2013-05-03 17:02:53 +02:00
|
|
|
|
2016-07-22 08:46:13 +02:00
|
|
|
use PHPCensor\Model\Build;
|
2016-07-11 18:00:04 +02:00
|
|
|
|
2013-05-16 03:16:56 +02:00
|
|
|
/**
|
2016-07-11 18:00:04 +02:00
|
|
|
* PHPCI Plugin class - Used by all build plugins.
|
|
|
|
*
|
2016-07-22 08:46:13 +02:00
|
|
|
* @author Dan Cryer <dan@block8.co.uk>
|
2013-05-16 03:16:56 +02:00
|
|
|
*/
|
2016-07-11 18:00:04 +02:00
|
|
|
abstract class Plugin
|
2013-05-03 17:02:53 +02:00
|
|
|
{
|
2016-07-11 18:00:04 +02:00
|
|
|
/**
|
2016-07-22 08:46:13 +02:00
|
|
|
* @var \PHPCensor\Builder
|
2016-07-11 18:00:04 +02:00
|
|
|
*/
|
2016-07-22 09:05:34 +02:00
|
|
|
protected $builder;
|
2016-07-11 18:00:04 +02:00
|
|
|
|
|
|
|
/**
|
2016-07-22 08:46:13 +02:00
|
|
|
* @var \PHPCensor\Model\Build
|
2016-07-11 18:00:04 +02:00
|
|
|
*/
|
|
|
|
protected $build;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $options;
|
|
|
|
|
|
|
|
/**
|
2016-07-22 09:05:34 +02:00
|
|
|
* @param Builder $builder
|
2016-07-11 18:00:04 +02:00
|
|
|
* @param Build $build
|
|
|
|
* @param array $options
|
|
|
|
*/
|
2016-07-22 09:05:34 +02:00
|
|
|
public function __construct(Builder $builder, Build $build, array $options = [])
|
2016-07-11 18:00:04 +02:00
|
|
|
{
|
2016-07-22 09:05:34 +02:00
|
|
|
$this->builder = $builder;
|
2016-07-11 18:00:04 +02:00
|
|
|
$this->build = $build;
|
|
|
|
$this->options = $options;
|
|
|
|
|
2016-07-22 09:05:34 +02:00
|
|
|
$this->builder->logDebug('Plugin options: ' . json_encode($options));
|
2016-07-11 18:00:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
abstract public function execute();
|
2013-05-16 03:57:02 +02:00
|
|
|
}
|