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