php-censor/src/PHPCensor/Plugin.php
2017-03-12 11:40:40 +07:00

72 lines
1.2 KiB
PHP

<?php
namespace PHPCensor;
use PHPCensor\Model\Build;
/**
* PHPCI Plugin class - Used by all build plugins.
*
* @author Dan Cryer <dan@block8.co.uk>
*/
abstract class Plugin
{
/**
* @var \PHPCensor\Builder
*/
protected $builder;
/**
* @var \PHPCensor\Model\Build
*/
protected $build;
/**
* @var array
*/
protected $options;
/**
* @param Builder $builder
* @param Build $build
* @param array $options
*/
public function __construct(Builder $builder, Build $build, array $options = [])
{
$this->builder = $builder;
$this->build = $build;
$this->options = $options;
$this->builder->logDebug('Plugin options: ' . json_encode($options));
}
/**
* @return Build
*/
public function getBuild()
{
return $this->build;
}
/**
* @return Builder
*/
public function getBuilder()
{
return $this->builder;
}
/**
* @return boolean
*/
abstract public function execute();
/**
* @return string
*/
public static function pluginName()
{
return '';
}
}