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
I was just experimenting with migrating a project from PHPStan level 9 to 10, and found a lot of instances of mixed types. I thought I'd open a tracking issue to figure out if and how those could be improved, either in phpstan-wordpress or (preferably) wordpress-stubs:
Couldn’t this be implemented directly in core? Core already uses the array<keyType, valueType> notation in some places. I also don’t see anything in the coding standards that leads me to believe array<keyType, valueType> is not permitted.
I was just experimenting with migrating a project from PHPStan level 9 to 10, and found a lot of instances of
mixed
types. I thought I'd open a tracking issue to figure out if and how those could be improved, either inphpstan-wordpress
or (preferably)wordpress-stubs
:get_registered_settings()
: document the shape of the returned settings (seeregister_setting()
)WP_Taxonomy::$labels
: define object shape with expected keys (seeget_taxonomy_labels()
)WP_Post_Type::$labels
: define object shape with expected keys (seeget_post_type_labels()
)WP_Taxonomy::$cap
: define object shape with expected keysWP_Post_Type::$cap
: define object shape with expected keys (seeget_post_type_capabilities()
)WP_User::$caps
: define asarray<string, bool>
wp_parse_args()
: could an extension be built to dynamically set the return type based on the shape of the arguments?The text was updated successfully, but these errors were encountered: