1 | <?php |
||
29 | class Timezone implements \Caridea\Validate\Rule |
||
30 | { |
||
31 | /** |
||
32 | * @var array The comparison value |
||
33 | */ |
||
34 | private $zones; |
||
35 | |||
36 | /** |
||
37 | * Creates a new Timezone Rule. |
||
38 | */ |
||
39 | 1 | protected function __construct() |
|
40 | { |
||
41 | 1 | $this->zones = timezone_identifiers_list(\DateTimeZone::ALL_WITH_BC); |
|
42 | 1 | } |
|
43 | |||
44 | /** |
||
45 | * {@inheritDoc} |
||
46 | */ |
||
47 | 1 | public function apply($value, $data = []): ?array |
|
54 | |||
55 | /** |
||
56 | * Gets a rule that tests a string as a valid timezone. |
||
57 | * |
||
58 | * @return \Caridea\Validate\Rule\Timezone the created rule |
||
59 | */ |
||
60 | 1 | public static function timezone(): Timezone |
|
64 | } |
||
65 |