Docs: Fix incorrect type for $crop param is various WP_Image_Editor classes and methods.

This changeset updates the `$crop` docblock type in various `WP_Image_Editor`, `WP_Image_Editor_GD` and `WP_Image_Editor_Imagick` functions, to match the 
type documented in `image_resize_dimensions()`.

Props thunderdw.
Fixes #58271.
See #57840.




git-svn-id: https://develop.svn.wordpress.org/trunk@56204 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras
2023-07-11 06:29:11 +00:00
parent 488e431aaa
commit 9b08513ce9
3 changed files with 24 additions and 24 deletions
+9 -9
View File
@@ -163,9 +163,9 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
*
* @since 3.5.0
*
* @param int|null $max_w Image width.
* @param int|null $max_h Image height.
* @param bool $crop
* @param int|null $max_w Image width.
* @param int|null $max_h Image height.
* @param bool|array $crop
* @return true|WP_Error
*/
public function resize( $max_w, $max_h, $crop = false ) {
@@ -236,9 +236,9 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
* @type array ...$0 {
* Array of height, width values, and whether to crop.
*
* @type int $width Image width. Optional if `$height` is specified.
* @type int $height Image height. Optional if `$width` is specified.
* @type bool $crop Optional. Whether to crop the image. Default false.
* @type int $width Image width. Optional if `$height` is specified.
* @type int $height Image height. Optional if `$width` is specified.
* @type bool|array $crop Optional. Whether to crop the image. Default false.
* }
* }
* @return array An array of resized images' metadata by size.
@@ -265,9 +265,9 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
* @param array $size_data {
* Array of size data.
*
* @type int $width The maximum width in pixels.
* @type int $height The maximum height in pixels.
* @type bool $crop Whether to crop the image to exact dimensions.
* @type int $width The maximum width in pixels.
* @type int $height The maximum height in pixels.
* @type bool|array $crop Whether to crop the image to exact dimensions.
* }
* @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta,
* WP_Error object on error.
@@ -308,9 +308,9 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
*
* @since 3.5.0
*
* @param int|null $max_w Image width.
* @param int|null $max_h Image height.
* @param bool $crop
* @param int|null $max_w Image width.
* @param int|null $max_h Image height.
* @param bool|array $crop
* @return true|WP_Error
*/
public function resize( $max_w, $max_h, $crop = false ) {
@@ -495,9 +495,9 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
* @type array ...$0 {
* Array of height, width values, and whether to crop.
*
* @type int $width Image width. Optional if `$height` is specified.
* @type int $height Image height. Optional if `$width` is specified.
* @type bool $crop Optional. Whether to crop the image. Default false.
* @type int $width Image width. Optional if `$height` is specified.
* @type int $height Image height. Optional if `$width` is specified.
* @type bool|array $crop Optional. Whether to crop the image. Default false.
* }
* }
* @return array An array of resized images' metadata by size.
@@ -524,9 +524,9 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
* @param array $size_data {
* Array of size data.
*
* @type int $width The maximum width in pixels.
* @type int $height The maximum height in pixels.
* @type bool $crop Whether to crop the image to exact dimensions.
* @type int $width The maximum width in pixels.
* @type int $height The maximum height in pixels.
* @type bool|array $crop Whether to crop the image to exact dimensions.
* }
* @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta,
* WP_Error object on error.
+6 -6
View File
@@ -104,9 +104,9 @@ abstract class WP_Image_Editor {
* @since 3.5.0
* @abstract
*
* @param int|null $max_w Image width.
* @param int|null $max_h Image height.
* @param bool $crop
* @param int|null $max_w Image width.
* @param int|null $max_h Image height.
* @param bool|array $crop
* @return true|WP_Error
*/
abstract public function resize( $max_w, $max_h, $crop = false );
@@ -121,9 +121,9 @@ abstract class WP_Image_Editor {
* An array of image size arrays. Default sizes are 'small', 'medium', 'large'.
*
* @type array ...$0 {
* @type int $width Image width.
* @type int $height Image height.
* @type bool $crop Optional. Whether to crop the image. Default false.
* @type int $width Image width.
* @type int $height Image height.
* @type bool|array $crop Optional. Whether to crop the image. Default false.
* }
* }
* @return array An array of resized images metadata by size.