PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.3.53
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.3.53
1.4.17 1.4.16 1.4.15 1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.54 1.3.53 1.3.52 1.3.51 1.3.50 1.3.49 1.3.48 All 180 releases
disco / vendor / micropackage / requirements / src / Abstracts / Checker.php

Checker.php in Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO 1.3.53, at vendor/micropackage/requirements/src/Abstracts/Checker.php

73 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Checker abstract
4 *
5 * @package micropackage/requirements
6 */
7
8 namespace Micropackage\Requirements\Abstracts;
9
10 use Micropackage\Requirements\Interfaces;
11
12 /**
13 * Checker abstract
14 */
15 abstract class Checker implements Interfaces\Checkable {
16
17 /**
18 * Checker name
19 *
20 * @var string
21 */
22 protected $name = '';
23
24 /**
25 * Error messages
26 *
27 * @var array
28 */
29 protected $errors = [];
30
31 /**
32 * Checks if the requirement is met
33 *
34 * @since 1.0.0
35 * @param mixed $value Value to check against.
36 * @return void
37 */
38 abstract public function check( $value );
39
40 /**
41 * Gets checker name
42 *
43 * @since 1.0.0
44 * @return string
45 */
46 public function get_name() {
47 return $this->name;
48 }
49
50 /**
51 * Adds error message
52 *
53 * @since 1.0.0
54 * @param string $message Error message.
55 * @return $this
56 */
57 public function add_error( $message ) {
58 $this->errors[] = $message;
59 return $this;
60 }
61
62 /**
63 * Gets all errors
64 *
65 * @since 1.0.0
66 * @return array
67 */
68 public function get_errors() {
69 return $this->errors;
70 }
71
72 }
73