<?php


require_once 'PHPUnit/Util/Metrics.php';
require_once 'PHPUnit/Util/Filter.php';

PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');

/**
 * Abstract base class for PMD rule classes.
 *
 * @category   Testing
 * @package    PHPUnit
 * @author     Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @copyright  2002-2009 Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    Release: @package_version@
 * @link       http://www.phpunit.de/
 * @since      Class available since Release 3.2.0
 */
abstract class PHPUnit_Util_Log_PMD_Rule
{
    protected $threshold;
    protected $priority;

    public function __construct($threshold, $priority = 1)
    {
        $this->threshold = $threshold;
        $this->priority  = $priority;
    }

    public function getName()
    {
        $name = explode('_', get_class($this));

        return array_pop($name);
    }

    public function getPriority()
    {
        return $this->priority;
    }

    abstract public function apply(PHPUnit_Util_Metrics $metrics);
}
?>
