Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | /** |
| 3 | * Pop PHP Framework (http://www.popphp.org/) |
| 4 | * |
| 5 | * @link https://github.com/popphp/popphp-framework |
| 6 | * @author Nick Sagona, III <dev@noladev.com> |
| 7 | * @copyright Copyright (c) 2009-2025 NOLA Interactive, LLC. |
| 8 | * @license http://www.popphp.org/license New BSD License |
| 9 | */ |
| 10 | |
| 11 | /** |
| 12 | * @namespace |
| 13 | */ |
| 14 | namespace Pop\Validator; |
| 15 | |
| 16 | /** |
| 17 | * Validator interface |
| 18 | * |
| 19 | * @category Pop |
| 20 | * @package Pop\Validator |
| 21 | * @author Nick Sagona, III <dev@noladev.com> |
| 22 | * @copyright Copyright (c) 2009-2025 NOLA Interactive, LLC. |
| 23 | * @license http://www.popphp.org/license New BSD License |
| 24 | * @version 4.5.0 |
| 25 | */ |
| 26 | interface ValidatorInterface |
| 27 | { |
| 28 | |
| 29 | /** |
| 30 | * Get the validator name |
| 31 | * |
| 32 | * @return ?string |
| 33 | */ |
| 34 | public function getName(): ?string; |
| 35 | |
| 36 | /** |
| 37 | * Get the validator description |
| 38 | * |
| 39 | * @return ?string |
| 40 | */ |
| 41 | public function getDescription(): ?string; |
| 42 | |
| 43 | /** |
| 44 | * Get the validator value |
| 45 | * |
| 46 | * @return mixed |
| 47 | */ |
| 48 | public function getValue(): mixed; |
| 49 | |
| 50 | /** |
| 51 | * Get the validator default message |
| 52 | * |
| 53 | * @return string|null |
| 54 | */ |
| 55 | public function getMessage(): string|null; |
| 56 | |
| 57 | /** |
| 58 | * Get the validator input |
| 59 | * |
| 60 | * @return mixed |
| 61 | */ |
| 62 | public function getInput(): mixed; |
| 63 | |
| 64 | /** |
| 65 | * Get the validator results |
| 66 | * |
| 67 | * @return mixed |
| 68 | */ |
| 69 | public function getResults(): mixed; |
| 70 | |
| 71 | /** |
| 72 | * Has validator name |
| 73 | * |
| 74 | * @return bool |
| 75 | */ |
| 76 | public function hasName(): bool; |
| 77 | |
| 78 | /** |
| 79 | * Has validator description |
| 80 | * |
| 81 | * @return bool |
| 82 | */ |
| 83 | public function hasDescription(): bool; |
| 84 | |
| 85 | /** |
| 86 | * Has validator value |
| 87 | * |
| 88 | * @return bool |
| 89 | */ |
| 90 | public function hasValue(): bool; |
| 91 | |
| 92 | /** |
| 93 | * Has validator message |
| 94 | * |
| 95 | * @return bool |
| 96 | */ |
| 97 | public function hasMessage(): bool; |
| 98 | |
| 99 | /** |
| 100 | * Has validator input |
| 101 | * |
| 102 | * @return bool |
| 103 | */ |
| 104 | public function hasInput(): bool; |
| 105 | |
| 106 | /** |
| 107 | * Has validator results |
| 108 | * |
| 109 | * @return bool |
| 110 | */ |
| 111 | public function hasResults(): bool; |
| 112 | |
| 113 | /** |
| 114 | * Set the validator name |
| 115 | * |
| 116 | * @param ?string $name |
| 117 | * @return static |
| 118 | */ |
| 119 | public function setName(?string $name = null): static; |
| 120 | |
| 121 | /** |
| 122 | * Set the validator description |
| 123 | * |
| 124 | * @param ?string $description |
| 125 | * @return static |
| 126 | */ |
| 127 | public function setDescription(?string $description = null): static; |
| 128 | |
| 129 | /** |
| 130 | * Set the validator value |
| 131 | * |
| 132 | * @param mixed $value |
| 133 | * @return ValidatorInterface |
| 134 | */ |
| 135 | public function setValue(mixed $value): ValidatorInterface; |
| 136 | |
| 137 | /** |
| 138 | * Set the validator default message |
| 139 | * |
| 140 | * @param ?string $message |
| 141 | * @return ValidatorInterface |
| 142 | */ |
| 143 | public function setMessage(?string $message = null): ValidatorInterface; |
| 144 | |
| 145 | /** |
| 146 | * Set the validator input |
| 147 | * |
| 148 | * @param mixed $input |
| 149 | * @return ValidatorInterface |
| 150 | */ |
| 151 | public function setInput(mixed $input = null): ValidatorInterface; |
| 152 | |
| 153 | /** |
| 154 | * Evaluate |
| 155 | * |
| 156 | * @param mixed $input |
| 157 | * @return bool |
| 158 | */ |
| 159 | public function evaluate(mixed $input = null): bool; |
| 160 | |
| 161 | /** |
| 162 | * Generate default message |
| 163 | |
| 164 | * @param mixed $name |
| 165 | * @param mixed $value |
| 166 | * @return string |
| 167 | */ |
| 168 | public function generateDefaultMessage(mixed $name = null, mixed $value = null): string; |
| 169 | |
| 170 | } |