1 | <?php |
||
11 | class FileRulesTextHelper |
||
12 | { |
||
13 | /** |
||
14 | * @var array Validation rules |
||
15 | */ |
||
16 | private $rules; |
||
17 | /** |
||
18 | * @var array Validation rules of image |
||
19 | */ |
||
20 | private $imageSize; |
||
21 | /** |
||
22 | * @var string Delimiter for rules |
||
23 | */ |
||
24 | private $delimiter = '<br>'; |
||
25 | |||
26 | /** |
||
27 | * @param array $rules Validation rules |
||
28 | * @param string $delimiter Delimiter for rules. Default `<br>` |
||
29 | */ |
||
30 | public function __construct(array $rules, $delimiter = null) |
||
39 | |||
40 | /** |
||
41 | * Get a description of the validation rules in as text |
||
42 | * |
||
43 | * @return string |
||
44 | */ |
||
45 | public function __toString() |
||
56 | |||
57 | /** |
||
58 | * Get description for rule the `maximum size` |
||
59 | * |
||
60 | * @return string|null |
||
61 | */ |
||
62 | public function maxSizeDescription(): ?string |
||
71 | |||
72 | /** |
||
73 | * Get description for rule the `maximum count of files` |
||
74 | * |
||
75 | * @return string|null |
||
76 | */ |
||
77 | public function maxFilesDescription(): ?string |
||
86 | |||
87 | /** |
||
88 | * Get description for rule the `allowed extensions` |
||
89 | * |
||
90 | * @return string|null |
||
91 | */ |
||
92 | public function extensionDescription(): ?string |
||
101 | |||
102 | /** |
||
103 | * Get description for rule the `image sizes` |
||
104 | * |
||
105 | * @return string|null |
||
106 | */ |
||
107 | public function imageSizeDescription(): ?string |
||
137 | |||
138 | /** |
||
139 | * Whether the image has strict size |
||
140 | * |
||
141 | * @return bool |
||
142 | */ |
||
143 | public function isImageStrictSize(): bool |
||
152 | |||
153 | /** |
||
154 | * Get description for image with strict size |
||
155 | * |
||
156 | * @return string |
||
157 | */ |
||
158 | public function imageStrictSizeDescription(): string |
||
165 | |||
166 | /** |
||
167 | * Whether the image has max and min size |
||
168 | * |
||
169 | * @return bool |
||
170 | */ |
||
171 | public function isImageMinAndMaxSize(): bool |
||
175 | |||
176 | /** |
||
177 | * Whether the image has min size |
||
178 | * |
||
179 | * @return bool |
||
180 | */ |
||
181 | public function isImageMinSize(): bool |
||
188 | |||
189 | /** |
||
190 | * Get description for image with min size |
||
191 | * |
||
192 | * @return string |
||
193 | */ |
||
194 | public function imageMinSizeDescription(): string |
||
201 | |||
202 | /** |
||
203 | * Whether the image has max size |
||
204 | * |
||
205 | * @return bool |
||
206 | */ |
||
207 | public function isImageMaxSize(): bool |
||
214 | |||
215 | /** |
||
216 | * Get description for image with max size |
||
217 | * |
||
218 | * @return string |
||
219 | */ |
||
220 | public function imageMaxSizeDescription(): string |
||
227 | |||
228 | private function imageRules(array $exclude = []): array |
||
255 | } |
||
256 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..