| 1 | <?php |
||
| 7 | class ContentsFileValidation extends Validation |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * checkMaxSize |
||
| 11 | * |
||
| 12 | */ |
||
| 13 | public static function checkMaxSize($value, $max, $context) |
||
| 18 | |||
| 19 | /** |
||
| 20 | * uploadMaxSizeCheck |
||
| 21 | * |
||
| 22 | */ |
||
| 23 | public static function uploadMaxSizeCheck($value, $context) |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Calculate file size by unit |
||
| 30 | * |
||
| 31 | * e.g.) 100KB -> 1024000 |
||
| 32 | * |
||
| 33 | * @param $size mixed |
||
| 34 | * @return int file size |
||
| 35 | */ |
||
| 36 | private static function calcFileSizeUnit($size) |
||
| 48 | |||
| 49 | /** |
||
| 50 | * checkExtension |
||
| 51 | * 拡張子のチェック |
||
| 52 | * |
||
| 53 | * @param $value mixed |
||
| 54 | * @return bool |
||
| 55 | */ |
||
| 56 | public static function checkExtension($value, $extensions = ['gif', 'jpeg', 'png', 'jpg']) |
||
| 73 | } |
||
| 74 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.