CaptchaValidator.php
1 month ago
RecaptchaValidator.php
2 months ago
TurnstileValidator.php
2 months ago
ValidationError.php
2 months ago
index.php
1 year ago
ValidationError.php
27 lines
| 1 | <?php declare(strict_types = 1); |
| 2 | |
| 3 | namespace MailPoet\Captcha\Validator; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | class ValidationError extends \RuntimeException { |
| 9 | |
| 10 | private $meta = []; |
| 11 | |
| 12 | public function __construct( |
| 13 | $message = "", |
| 14 | array $meta = [], |
| 15 | $code = 0, |
| 16 | ?\Throwable $previous = null |
| 17 | ) { |
| 18 | $this->meta = $meta; |
| 19 | $this->meta['error'] = $message; |
| 20 | parent::__construct($message, $code, $previous); |
| 21 | } |
| 22 | |
| 23 | public function getMeta(): array { |
| 24 | return $this->meta; |
| 25 | } |
| 26 | } |
| 27 |