php-censor/src/PHPCensor/Plugin.php

79 lines
1.4 KiB
PHP
Raw Normal View History

2013-05-03 17:02:53 +02:00
<?php
2013-05-16 03:16:56 +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
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.
*
* @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
/**
* @var \PHPCensor\Builder
2016-07-11 18:00:04 +02:00
*/
protected $builder;
2016-07-11 18:00:04 +02:00
/**
* @var \PHPCensor\Model\Build
2016-07-11 18:00:04 +02:00
*/
protected $build;
/**
* @var array
*/
protected $options;
/**
* @param Builder $builder
2016-07-11 18:00:04 +02:00
* @param Build $build
* @param array $options
*/
public function __construct(Builder $builder, Build $build, array $options = [])
2016-07-11 18:00:04 +02:00
{
$this->builder = $builder;
2016-07-11 18:00:04 +02:00
$this->build = $build;
$this->options = $options;
$this->builder->logDebug('Plugin options: ' . json_encode($options));
2016-07-11 18:00:04 +02:00
}
2017-01-06 05:14:45 +01:00
/**
* @return Build
*/
public function getBuild()
{
return $this->build;
}
/**
* @return Builder
*/
public function getBuilder()
{
return $this->builder;
}
2016-07-11 18:00:04 +02:00
/**
* @return boolean
*/
abstract public function execute();
2017-01-11 16:15:54 +01:00
/**
* @return string
*/
public static function pluginName()
{
return '';
}
}