Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue: Improve types for certain functions #274

Open
7 tasks
swissspidy opened this issue Dec 3, 2024 · 2 comments
Open
7 tasks

Tracking issue: Improve types for certain functions #274

swissspidy opened this issue Dec 3, 2024 · 2 comments
Assignees

Comments

@swissspidy
Copy link
Contributor

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:

@IanDelMar
Copy link
Contributor

  • WP_User::$caps: define as array<string, bool>

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.

@swissspidy
Copy link
Contributor Author

Yeah maybe. But also in the stubs repo it could be enhanced to use generics perhaps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants