| @@ -39,13 +39,18 @@ | ||
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * Determines whether the passed URL is considered valid. |
| 42 | 42 | * |
| 43 | - * @param array $image The image array. | |
| 43 | + * @deprecated 22.4 | |
| 44 | + * @codeCoverageIgnore | |
| 44 | 45 | * |
| 46 | + * @param array<array<string, string|int>> $image The image array. | |
| 47 | + * | |
| 45 | 48 | * @return bool Whether or not the URL is a valid image. |
| 46 | 49 | */ |
| 47 | 50 | public function is_image_url_valid( array $image ) { |
| 51 | + \_deprecated_function( __METHOD__, 'Yoast SEO 22.4' ); | |
| 52 | + | |
| 48 | 53 | if ( empty( $image['url'] ) || ! \is_string( $image['url'] ) ) { |
| 49 | 54 | return false; |
| 50 | 55 | } |
| 51 | 56 | |
| @@ -54,11 +59,10 @@ | ||
| 54 | 59 | |
| 55 | 60 | /** |
| 56 | 61 | * Filter: 'wpseo_opengraph_is_valid_image_url' - Allows extra validation for an image url. |
| 57 | 62 | * |
| 58 | - * @api bool - Current validation result. | |
| 59 | - * | |
| 60 | - * @param string $url The image url to validate. | |
| 63 | + * @param bool $is_valid Current validation result. | |
| 64 | + * @param string $url The image url to validate. | |
| 61 | 65 | */ |
| 62 | 66 | return (bool) \apply_filters( 'wpseo_opengraph_is_valid_image_url', $is_valid, $image['url'] ); |
| 63 | 67 | } |
| 64 | 68 | |
| @@ -79,9 +83,9 @@ | ||
| 79 | 83 | * Use the `wpseo_image_sizes` filter if you want to use our logic. That filter |
| 80 | 84 | * can be used to add an image size that needs to be taken into consideration |
| 81 | 85 | * within our own logic. |
| 82 | 86 | * |
| 83 | - * @api string|false $size Size string. | |
| 87 | + * @param string|false $size Size string. | |
| 84 | 88 | */ |
| 85 | 89 | return \apply_filters( 'wpseo_opengraph_image_size', null ); |
| 86 | 90 | } |
| 87 | 91 | |
| @@ -89,9 +93,9 @@ | ||
| 89 | 93 | * Retrieves the image data by a given attachment id. |
| 90 | 94 | * |
| 91 | 95 | * @param int $attachment_id The attachment id. |
| 92 | 96 | * |
| 93 | - * @return array|false The image data when found, `false` when not. | |
| 97 | + * @return array<string, string|int>|false The image data when found, `false` when not. | |
| 94 | 98 | */ |
| 95 | 99 | public function get_image_by_id( $attachment_id ) { |
| 96 | 100 | if ( ! $this->image->is_valid_attachment( $attachment_id ) ) { |
| 97 | 101 | return false; |