Skip to content

Conversation

@westonruter
Copy link
Member

@westonruter westonruter commented May 3, 2024

See #775.

This fixes the following PHPStan issues:

 ------ -------------------------------------------------------------------- 
  Line   plugins/dominant-color-images/helper.php                            
 ------ -------------------------------------------------------------------- 
  76     Call to an undefined method WP_Image_Editor::has_transparency().    
  82     Call to an undefined method WP_Image_Editor::get_dominant_color().  
 ------ -------------------------------------------------------------------- 

Note that PHPStan is correctly identifying a bug here which could cause a fatal error in case another plugin is filtering wp_image_editors so that our specific subclasses are not used.

@westonruter westonruter added the [Type] Bug An existing feature is broken label May 3, 2024
@westonruter westonruter added this to the performance-lab 3.1.0 milestone May 3, 2024
@github-actions
Copy link

github-actions bot commented May 3, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: westonruter <[email protected]>
Co-authored-by: mukeshpanchal27 <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@westonruter westonruter force-pushed the update/phpstan-level-2 branch from f4fec1f to 7fd8cde Compare May 4, 2024 00:24
@westonruter westonruter requested a review from thelovekesh May 4, 2024 00:58
Base automatically changed from update/phpstan-level-1 to trunk May 6, 2024 05:34
}
add_filter( 'wp_image_editors', 'dominant_color_set_image_editors' );

/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's right. Without /** then the phpdoc is not parsed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs you link to are talking about a regular multiline comment, not one that serves as a doc block.

@westonruter westonruter merged commit cdf67e2 into trunk May 6, 2024
@westonruter westonruter deleted the update/phpstan-level-2 branch May 6, 2024 05:45
@westonruter westonruter added the skip changelog PRs that should not be mentioned in changelogs label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog PRs that should not be mentioned in changelogs [Type] Bug An existing feature is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants