| Conditions | 5 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 56 | public static function checkExtension($value, $extensions = ['gif', 'jpeg', 'png', 'jpg']) |
||
| 57 | { |
||
| 58 | // データがない場合はチェックしない |
||
| 59 | if (!is_array($value) || !array_key_exists('name', $value)) { |
||
| 60 | return true; |
||
| 61 | } |
||
| 62 | $check = $value['name']; |
||
| 63 | |||
| 64 | $extension = strtolower(pathinfo($check, PATHINFO_EXTENSION)); |
||
| 65 | foreach ($extensions as $value) { |
||
| 66 | if ($extension === strtolower($value)) { |
||
| 67 | return true; |
||
| 68 | } |
||
| 69 | } |
||
| 70 | |||
| 71 | return false; |
||
| 72 | } |
||
| 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.