| @@ -15,9 +15,9 @@ | ||
| 15 | 15 | public static function get_attachment_files($attachment_id) { |
| 16 | 16 | $attachment_images = array(); |
| 17 | 17 | $upload_dir = wp_get_upload_dir(); |
| 18 | 18 | |
| 19 | - // get sizes info from attachment meta data. | |
| 19 | + // get sizes info from attachment metadata. | |
| 20 | 20 | $meta = wp_get_attachment_metadata($attachment_id); |
| 21 | 21 | if (!is_array($meta) || !array_key_exists('sizes', $meta)) return $attachment_images; |
| 22 | 22 | |
| 23 | 23 | $image_sizes = array_keys($meta['sizes']); |
| @@ -50,13 +50,13 @@ | ||
| 50 | 50 | * Returns given file extension |
| 51 | 51 | * |
| 52 | 52 | * @param string $file |
| 53 | 53 | * |
| 54 | - * @return mixed | |
| 54 | + * @return string | |
| 55 | 55 | */ |
| 56 | - public static function get_extension($file) { | |
| 56 | + public static function get_extension($file): string { | |
| 57 | 57 | $file_type = wp_check_filetype($file); |
| 58 | - return $file_type['ext']; | |
| 58 | + return (string) $file_type['ext']; | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * Tests if given extension is present in allowed extensions array |