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

Docs: improve consistency and specificity #826

Merged
merged 6 commits into from
Nov 8, 2024

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Nov 8, 2024

Context

This Monday, PHPStan 2.0 will be released.

I've done some preliminary scans with PHPStan 2.0-dev to check if this would have an impact on this codebase.

Based on that, the changes made in commits 12154a6 and b95dde7 are necessary to prevent the CI builds from failing once PHPStan 2.0 comes out.

As I was looking through the doc type declarations anyway, I've enhanced a significant number of other array types as well, though there is more to be done still.

Commits

Docs: improve consistency and specificity [1]

This fixes up the @return type declarations for all register() methods.

Docs: improve consistency and specificity [2]

This fixes up the @var type declarations for all AbstractFunctionParameterSniff::$target_functions properties.

Docs: improve consistency and specificity [3]

This fixes up the @return type declarations for all AbstractVariableRestrictionsSniff::getGroups() methods.

Docs: improve consistency and specificity [4]

This fixes up the @return type declarations for all AbstractArrayAssignmentRestrictionsSniff::getGroups() methods.

DeclarationCompatibility::$checkClasses: improve type specificity

Docs: improve specificity

Miscellaneous other doc specificity fixes.

Note: this doesn't fix everything throughout the codebase, but is an iteration to improve things nonetheless.

This fixes up the `@return` type declarations for all `register()` methods.
This fixes up the `@var` type declarations for all `AbstractFunctionParameterSniff::$target_functions` properties.
This fixes up the `@return` type declarations for all `AbstractVariableRestrictionsSniff::getGroups()` methods.
This fixes up the `@return` type declarations for all `AbstractArrayAssignmentRestrictionsSniff::getGroups()` methods.
Miscellaneous other doc specificity fixes.

Note: this doesn't fix everything throughout the codebase, but is an iteration to improve things nonetheless.
@jrfnl jrfnl added this to the 3.x milestone Nov 8, 2024
@jrfnl jrfnl requested a review from a team as a code owner November 8, 2024 11:17
@GaryJones GaryJones merged commit ff4acee into develop Nov 8, 2024
40 checks passed
@GaryJones GaryJones deleted the feature/docs-improve-specificity branch November 8, 2024 13:43
@jrfnl
Copy link
Collaborator Author

jrfnl commented Nov 11, 2024

FYI: I've just verified (now PHPStan 2.0 has been released) and we're good: https://github.com/Automattic/VIP-Coding-Standards/actions/runs/11775868645

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

Successfully merging this pull request may close these issues.

2 participants