1 | <?php |
||
8 | class ContentsFileValidation extends Validation |
||
9 | { |
||
10 | /** |
||
11 | * checkMaxSize |
||
12 | * |
||
13 | * @param UploadedFile $value |
||
14 | * @param int|string $max |
||
15 | * @param mixed $context |
||
16 | * @return bool |
||
17 | */ |
||
18 | public static function checkMaxSize(UploadedFile $value, $max, $context): bool |
||
23 | |||
24 | /** |
||
25 | * uploadMaxSizeCheck |
||
26 | * |
||
27 | * @param UploadedFile $value |
||
28 | * @param mixed $context |
||
29 | * @return bool |
||
30 | */ |
||
31 | public static function uploadMaxSizeCheck(UploadedFile $value, $context): bool |
||
35 | |||
36 | /** |
||
37 | * Calculate file size by unit |
||
38 | * |
||
39 | * e.g.) 100KB -> 1024000 |
||
40 | * |
||
41 | * @param int|string $size |
||
42 | * @return int|bool |
||
43 | */ |
||
44 | private static function calcFileSizeUnit($size) |
||
56 | |||
57 | /** |
||
58 | * checkExtension |
||
59 | * 拡張子のチェック |
||
60 | * |
||
61 | * @param UploadedFile $value |
||
62 | * @param array $extensions |
||
63 | * @return bool |
||
64 | */ |
||
65 | public static function checkExtension(UploadedFile $value, array $extensions = ['gif', 'jpeg', 'png', 'jpg']): bool |
||
81 | |||
82 | /* ドラッグアンドドロップアップロード専用 @Todo: 後*/ |
||
83 | /** |
||
84 | * extensionDd |
||
85 | * 拡張子のチェック |
||
86 | * |
||
87 | * @param string $value |
||
88 | * @param array $extensions |
||
89 | * @param string $filenameField |
||
90 | * @param mixed $context |
||
91 | * @return bool |
||
92 | */ |
||
93 | public static function extensionDd(string $value, array $extensions, string $filenameField, $context): bool |
||
109 | |||
110 | } |
||
111 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.