@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | /** |
88 | 88 | * Return an array of mime_type items allowed when the media file is uploaded. |
89 | 89 | * |
90 | - * @return array mime_type array |
|
90 | + * @return string[] mime_type array |
|
91 | 91 | */ |
92 | 92 | static function get_allowed_mime_types( $default_mime_types ) { |
93 | 93 | return array_unique( array_merge( $default_mime_types, array( |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | * @param object $media_item - media post object |
253 | 253 | * @param file $file - file recently added |
254 | 254 | * @param bool $has_original_media - condition is the original media has been already added |
255 | - * @return bool `true` if the item has been added. Otherwise `false`. |
|
255 | + * @return false|null `true` if the item has been added. Otherwise `false`. |
|
256 | 256 | */ |
257 | 257 | public static function register_revision( $media_item, $file, $has_original_media ) { |
258 | 258 | if ( is_wp_error( $file ) || ! $has_original_media ) { |
@@ -280,6 +280,9 @@ discard block |
||
280 | 280 | return $original; |
281 | 281 | } |
282 | 282 | |
283 | + /** |
|
284 | + * @param string $pathname |
|
285 | + */ |
|
283 | 286 | public static function delete_file( $pathname ) { |
284 | 287 | if ( ! file_exists( $pathname ) || ! is_file( $pathname ) ) { |
285 | 288 | // let's touch a fake file to try to `really` remove the media file |
@@ -295,7 +298,7 @@ discard block |
||
295 | 298 | * |
296 | 299 | * @param number $media_id - media post ID |
297 | 300 | * @param string $filename - basename of the file ( name-of-file.ext ) |
298 | - * @return bool `true` is the file has been removed, `false` if not. |
|
301 | + * @return boolean|null `true` is the file has been removed, `false` if not. |
|
299 | 302 | */ |
300 | 303 | private static function delete_media_history_file( $media_id, $filename ) { |
301 | 304 | $attached_path = get_attached_file( $media_id ); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | * Update the media post grabbing the post values from |
14 | 14 | * the `attrs` parameter |
15 | 15 | * |
16 | - * @param {Number} $media_id - post media ID |
|
16 | + * @param integer $media_id - post media ID |
|
17 | 17 | * @param {Object} $attrs - `attrs` parameter sent from the client in the request body |
18 | 18 | * @return |
19 | 19 | */ |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | /** |
78 | 78 | * Get the image from a remote url and then save it locally. |
79 | 79 | * |
80 | - * @param {Number} $media_id - media post ID |
|
80 | + * @param integer $media_id - media post ID |
|
81 | 81 | * @param {String} $url - image URL to save locally |
82 | 82 | * @return {Array|WP_Error} An array with information about the new file saved or a WP_Error is something went wrong. |
83 | 83 | */ |