Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#58271 closed defect (bug) (fixed)

Docs: WP_Image_Editor classes have incorrect type for $crop in docblocks

Reported by: thunderdw Owned by: audrasjb
Priority: normal Milestone: 6.3
Component: Media Version:
Severity: trivial Keywords: has-patch
Cc: Focuses: docs

Description

The docblocks for the WP_Image_Editor resize() and multi_resize() functions indicate that $crop is of type bool, instead of bool|array. The implementations of these functions by WP_Image_Editor_Imagick and WP_Image_Editor_GD also have these docblock errors, and they additionally both have the error in the docblock for their make_subsize() functions.

The $crop docblock type should match the type documented in image_resize_dimensions().

Affected files:

  • wp-includes/class-wp-image-editor-gd.php
  • wp-includes/class-wp-image-editor-imagick.php
  • wp-includes/class-wp-image-editor.php

Change History (7)

#1 @audrasjb
3 years ago

  • Milestone Awaiting Review → 6.3
  • Version trunk

This ticket was mentioned in ​PR #4434 on ​WordPress/wordpress-develop by ​thunderdw.


3 years ago
#2

  • Keywords has-patch added

This ticket was mentioned in ​Slack in #core-media by antpb. ​View the logs.


3 years ago

This ticket was mentioned in ​Slack in #core by mukeshpanchal27. ​View the logs.


3 years ago

#5 @audrasjb
3 years ago

  • Owner changed from thunderdw to audrasjb
  • Status assigned → reviewing

Self assigning for review/commit.

#6 @audrasjb
3 years ago

  • Resolution → fixed
  • Status reviewing → closed

In 56204:

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.

Note: See TracTickets for help on using tickets.