| @@ -10,15 +10,8 @@ | ||
| 10 | 10 | */ |
| 11 | 11 | class Image_Helper { |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | - * The URL helper. | |
| 15 | - * | |
| 16 | - * @var Url_Helper | |
| 17 | - */ | |
| 18 | - private $url; | |
| 19 | - | |
| 20 | - /** | |
| 21 | 14 | * The base image helper. |
| 22 | 15 | * |
| 23 | 16 | * @var Base_Image_Helper |
| 24 | 17 | */ |
| @@ -28,43 +21,13 @@ | ||
| 28 | 21 | * Image_Helper constructor. |
| 29 | 22 | * |
| 30 | 23 | * @codeCoverageIgnore |
| 31 | 24 | * |
| 32 | - * @param Url_Helper $url The url helper. | |
| 25 | + * @param Url_Helper $url The url helper. Deprecated since 28.6 and no longer used. | |
| 33 | 26 | * @param Base_Image_Helper $image The image helper. |
| 34 | 27 | */ |
| 35 | - public function __construct( Url_Helper $url, Base_Image_Helper $image ) { | |
| 36 | - $this->url = $url; | |
| 28 | + public function __construct( Url_Helper $url, Base_Image_Helper $image ) { // @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found, VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- $url is deprecated, kept for BC reasons. | |
| 37 | 29 | $this->image = $image; |
| 38 | - } | |
| 39 | - | |
| 40 | - /** | |
| 41 | - * Determines whether the passed URL is considered valid. | |
| 42 | - * | |
| 43 | - * @deprecated 22.4 | |
| 44 | - * @codeCoverageIgnore | |
| 45 | - * | |
| 46 | - * @param array<array<string, string|int>> $image The image array. | |
| 47 | - * | |
| 48 | - * @return bool Whether or not the URL is a valid image. | |
| 49 | - */ | |
| 50 | - public function is_image_url_valid( array $image ) { | |
| 51 | - \_deprecated_function( __METHOD__, 'Yoast SEO 22.4' ); | |
| 52 | - | |
| 53 | - if ( empty( $image['url'] ) || ! \is_string( $image['url'] ) ) { | |
| 54 | - return false; | |
| 55 | - } | |
| 56 | - | |
| 57 | - $image_extension = $this->url->get_extension_from_url( $image['url'] ); | |
| 58 | - $is_valid = $this->image->is_extension_valid( $image_extension ); | |
| 59 | - | |
| 60 | - /** | |
| 61 | - * Filter: 'wpseo_opengraph_is_valid_image_url' - Allows extra validation for an image url. | |
| 62 | - * | |
| 63 | - * @param bool $is_valid Current validation result. | |
| 64 | - * @param string $url The image url to validate. | |
| 65 | - */ | |
| 66 | - return (bool) \apply_filters( 'wpseo_opengraph_is_valid_image_url', $is_valid, $image['url'] ); | |
| 67 | 30 | } |
| 68 | 31 | |
| 69 | 32 | /** |
| 70 | 33 | * Retrieves the overridden image size value. |