# disco/1.3.48/vendor/micropackage/requirements/src/Abstracts/Checker.php

Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO, version 1.3.48. 73 lines.

- Page: https://pluginprobe.com/plugins/disco/1.3.48/code/vendor/micropackage/requirements/src/Abstracts/Checker.php
- Raw: https://pluginprobe.com/plugins/disco/1.3.48/raw/vendor/micropackage/requirements/src/Abstracts/Checker.php
- Modified: 2024-09-18T11:17:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/disco/1.3.48/code/vendor/micropackage/requirements/src/Abstracts/Checker.php#L10-L20`.

```php
<?php
/**
 * Checker abstract
 *
 * @package micropackage/requirements
 */

namespace Micropackage\Requirements\Abstracts;

use Micropackage\Requirements\Interfaces;

/**
 * Checker abstract
 */
abstract class Checker implements Interfaces\Checkable {

	/**
	 * Checker name
	 *
	 * @var string
	 */
	protected $name = '';

	/**
	 * Error messages
	 *
	 * @var array
	 */
	protected $errors = [];

	/**
	 * Checks if the requirement is met
	 *
	 * @since  1.0.0
	 * @param  mixed $value Value to check against.
	 * @return void
	 */
	abstract public function check( $value );

	/**
	 * Gets checker name
	 *
	 * @since  1.0.0
	 * @return string
	 */
	public function get_name() {
		return $this->name;
	}

	/**
	 * Adds error message
	 *
	 * @since  1.0.0
	 * @param  string $message Error message.
	 * @return $this
	 */
	public function add_error( $message ) {
		$this->errors[] = $message;
		return $this;
	}

	/**
	 * Gets all errors
	 *
	 * @since  1.0.0
	 * @return array
	 */
	public function get_errors() {
		return $this->errors;
	}

}

```
