1 | <?php |
||
8 | trait ValidatorTrait |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * @param string $value |
||
13 | * @return void |
||
14 | * @throws \InvalidArgumentException |
||
15 | */ |
||
16 | 2 | protected function isValidColor(string $value) |
|
22 | |||
23 | /** |
||
24 | * @param string $value |
||
25 | * @param int $length |
||
26 | * @return void |
||
27 | * @throws \InvalidArgumentException |
||
28 | */ |
||
29 | 31 | protected function isValidString(string $value, int $length = 20) |
|
35 | |||
36 | /** |
||
37 | * @param string $value |
||
38 | * @return void |
||
39 | * @throws \InvalidArgumentException |
||
40 | */ |
||
41 | 33 | protected function isValidUrl(string $value) |
|
47 | |||
48 | /** |
||
49 | * @param string $value |
||
50 | * @return void |
||
51 | * @throws \InvalidArgumentException |
||
52 | */ |
||
53 | 8 | protected function isValidLocale(string $value) |
|
59 | |||
60 | /** |
||
61 | * @param string $value |
||
62 | * @return void |
||
63 | * @throws \InvalidArgumentException |
||
64 | */ |
||
65 | 2 | protected function isValidCountry(string $value) |
|
71 | |||
72 | /** |
||
73 | * @param string $value |
||
74 | * @return void |
||
75 | * @throws \InvalidArgumentException |
||
76 | */ |
||
77 | 11 | protected function isValidDateTime(string $value) |
|
83 | |||
84 | /** |
||
85 | * @param array $array |
||
86 | * @param int $maxSize |
||
87 | * @param int $minSize |
||
88 | * @return void |
||
89 | * @throws \InvalidArgumentException |
||
90 | */ |
||
91 | 26 | protected function isValidArray(array $array, int $maxSize, int $minSize = null) |
|
101 | |||
102 | /** |
||
103 | * @param string $value |
||
104 | * @return void |
||
105 | * @throws \InvalidArgumentException |
||
106 | */ |
||
107 | 6 | protected function isValidCurrency(string $value) |
|
113 | |||
114 | /** |
||
115 | * @param string $filename |
||
116 | * @param array $allowedExtension |
||
117 | * @return void |
||
118 | * @throws \InvalidArgumentException |
||
119 | */ |
||
120 | 3 | protected function isValidExtension(string $filename, array $allowedExtension) |
|
127 | |||
128 | /** |
||
129 | * @param \Kerox\Messenger\Model\Common\Button\AbstractButton[] $buttons |
||
130 | * @param array $allowedButtonsType |
||
131 | * @return void |
||
132 | */ |
||
133 | 6 | protected function isValidButtons(array $buttons, array $allowedButtonsType) |
|
146 | } |
||
147 |