| 1 |
<?php |
| 2 |
|
| 3 |
namespace Give\Vendors\StellarWP\Validation\Rules; |
| 4 |
|
| 5 |
use Closure; |
| 6 |
|
| 7 |
class InStrict extends In |
| 8 |
{ |
| 9 |
/** |
| 10 |
* @since 1.2.0 |
| 11 |
*/ |
| 12 |
public static function id(): string |
| 13 |
{ |
| 14 |
return 'inStrict'; |
| 15 |
} |
| 16 |
|
| 17 |
/** |
| 18 |
* @since 1.2.0 |
| 19 |
*/ |
| 20 |
public function __invoke($value, Closure $fail, string $key, array $values) |
| 21 |
{ |
| 22 |
if (!in_array($value, $this->acceptedValues, true)) { |
| 23 |
$fail(sprintf(__('%s must be one of %s', 'give'), '{field}', implode(', ', $this->acceptedValues))); |
| 24 |
} |
| 25 |
} |
| 26 |
} |
| 27 |
|