Skip to content

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

@qlty-cloud-legacy
Copy link

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 Awaiting review before merging or closing type: chore Maintenance tasks, refactoring, and other non-functional changes scope: code quality Refactoring, linting, and enforcing coding standards labels Jan 3, 2024
@justlevine justlevine requested a review from jasonbahl January 3, 2024 01:30
@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
@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 Refactoring, linting, and enforcing coding standards status: in review Awaiting review before merging or closing type: chore Maintenance tasks, refactoring, and other non-functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants