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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: implement stricter PHPDoc types #3010

Merged

Conversation

justlevine
Copy link
Collaborator

What does this implement/fix? Explain your changes.

This PR adds stricter PHPDoc type definitions where possible and obvious.

More specifically:

  • Added PHPDoc shapes to multiple callable types.
  • Replaced the use of the mixed type with a more specific typedef wherever possible.
  • Gave array types traversable definitions wherever possible.

No actual code has been changed. If 3rd-party code is using an incorrect type, their IDE/linter will now show the type-smells (versus waiting for unexpected behavior and hoping the logs catch something).

Does this close any currently open issues?

Any relevant logs, error output, GraphiQL screenshots, etc?

Any other comments?

馃挱The stricter we can get our doc-blocks the easier itl be when work begins on V2 馃挱

Where has this been tested?

Operating System: Ubuntu 20.04 (wsl2 + devilbox + php 8.1.15)

WordPress Version: 6.4.2

Copy link

codeclimate bot commented Jan 3, 2024

Code Climate has analyzed commit e250141 and detected 0 issues on this pull request.

View more on Code Climate.

@justlevine justlevine added Status: In Review Needs to be reviewed by a project maintainer before merge Type: Chore (updating CI tasks etc; no production code change) scope: code quality Affects codebase complexity and maintainability labels Jan 3, 2024
@coveralls
Copy link

Coverage Status

coverage: 84.792%. remained the same
when pulling e250141 on justlevine:chore/stricter-phpdoc-types
into 683352d on wp-graphql:develop.

@jasonbahl jasonbahl merged commit 3d3d723 into wp-graphql:develop Jan 8, 2024
27 of 28 checks passed
@justlevine justlevine deleted the chore/stricter-phpdoc-types branch January 8, 2024 15:38
This was referenced Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code quality Affects codebase complexity and maintainability Status: In Review Needs to be reviewed by a project maintainer before merge Type: Chore (updating CI tasks etc; no production code change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants