You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The condition parameter accepts either an array or a string, as correctly indicated in the type hint and PHPDoc. However, in the @phpstan-param for $handle, condition it is set to string. We need to update the @phpstan-param to support array<string>|string.
The text was updated successfully, but these errors were encountered:
jessicamgoddard
changed the title
Fix type mismatch in $condition parameter for am_enqueue_script
Fix type mismatch for condition in am_enqueue_scriptMar 4, 2025
Description of the bug
PHPStan error when passing
condition
as an array in$handle
foram_enqueue_script
.Steps To Reproduce
Using
am_enqueue_script
, pass$handle
as an array containingcondition
which is also an array.https://github.com/newscorp-ghfb/ncu-gtf/blob/eb5b7ffa4d8b37431194f4d84c3f39fde2768d2b/themes/gtf/inc/assets/class-nypost-assets.php#L157-L171
Additional Information
The
condition
parameter accepts either an array or a string, as correctly indicated in the type hint and PHPDoc. However, in the@phpstan-param
for$handle
,condition
it is set tostring
. We need to update the@phpstan-param
to supportarray<string>|string
.The text was updated successfully, but these errors were encountered: