Conversation
| */ | ||
| public function it_should_return_default_transforms_when_filter_returns_non_array_type() { | ||
| /** @phpstan-ignore-next-line */ | ||
| add_filter( 'webp_uploads_upload_image_mime_transforms', '__return_null' ); |
There was a problem hiding this comment.
Strange. This is reported as an error for me locally but it isn't in GHA?
There was a problem hiding this comment.
It's also an error being reported in #898, but not in trunk.
There was a problem hiding this comment.
Is it maybe because of a different PHPStan strictness or other config? Or because of a different PHP version (which could lead to a diffferent PHPStan version)? 🤔
There was a problem hiding this comment.
Looks like a composer update fixed it!
|
On So that's why I did |
|
However, in 5c009ba @felixarntz observed that |
Summary
This fixes two PHPStan errors:
The
__return_empty_arrayis the appropriate callback for theperflab_active_modulesfilter, not__return_null.In this case, the desire is to test when an invalid return value is supplied for the
webp_uploads_upload_image_mime_transformsfilter, so in this case the PHPStan error is ignored.Checklist
[Focus]orInfrastructurelabel.[Type]label.no milestonelabel.