1 | <?php |
||
6 | trait ValidatorTrait |
||
7 | { |
||
8 | |||
9 | /** |
||
10 | * @param string $value |
||
11 | * @return void |
||
12 | * @throws \InvalidArgumentException |
||
13 | */ |
||
14 | protected function isValidColor(string $value) |
||
20 | |||
21 | /** |
||
22 | * @param string $value |
||
23 | * @param int $length |
||
24 | * @return void |
||
25 | * @throws \InvalidArgumentException |
||
26 | */ |
||
27 | protected function isValidString(string $value, int $length = 20) |
||
33 | |||
34 | /** |
||
35 | * @param string $value |
||
36 | * @return void |
||
37 | * @throws \InvalidArgumentException |
||
38 | */ |
||
39 | protected function isValidUrl(string $value) |
||
45 | |||
46 | /** |
||
47 | * @param string $value |
||
48 | * @return void |
||
49 | * @throws \InvalidArgumentException |
||
50 | */ |
||
51 | protected function isValidLocale(string $value) |
||
57 | |||
58 | /** |
||
59 | * @param string $value |
||
60 | * @return void |
||
61 | * @throws \InvalidArgumentException |
||
62 | */ |
||
63 | protected function isValidDateTime(string $value) |
||
69 | |||
70 | /** |
||
71 | * @param array $array |
||
72 | * @param int $maxSize |
||
73 | * @param int $minSize |
||
74 | * @return void |
||
75 | * @throws \InvalidArgumentException |
||
76 | */ |
||
77 | protected function isValidArray(array $array, int $maxSize, int $minSize = null) |
||
87 | |||
88 | /** |
||
89 | * @param string $value |
||
90 | * @return void |
||
91 | * @throws \InvalidArgumentException |
||
92 | */ |
||
93 | protected function isValidCurrency(string $value) |
||
99 | |||
100 | /** |
||
101 | * @param string $filename |
||
102 | * @param array $allowedExtension |
||
103 | * @return void |
||
104 | * @throws \InvalidArgumentException |
||
105 | */ |
||
106 | protected function isValidExtension(string $filename, array $allowedExtension) |
||
113 | } |
||
114 |