Skip to content

Conversation

@justlevine
Copy link
Collaborator

@justlevine justlevine commented Apr 19, 2025

What does this implement/fix? Explain your changes.

This PHP inlines return types for number functions where this change has been confirmed to be nonbreaking i.e.:

  • cant cause an error
  • wont cause an error
  • would already cause an error
  • are private and cant affect extenders/users

Native return types provide:

  • better IDE support (dont need an extra doc-block parser)
  • better LLM support (less likely to get confused or lose context)
  • better DX (since the error happens where it's caused and not where the correct type is expected ).
  • better refactorability (since we know what parts of the codebase are "safe".

Does this close any currently open issues?

No but I Should make more for all the 3.0 breaking type changes I wanna make 🧑‍🍳

@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit 1a4c6b1 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 needs: reviewer response This needs the attention of a codeowner or maintainer type: chore Maintenance tasks, refactoring, and other non-functional changes labels Apr 19, 2025
@justlevine justlevine requested a review from jasonbahl April 19, 2025 02:23
@coveralls
Copy link

Coverage Status

coverage: 82.607%. remained the same
when pulling 1a4c6b1 on justlevine:chore/native-return-types
into b82f17c on wp-graphql:develop.

@jasonbahl
Copy link
Collaborator

No but I Should make more for all the 3.0 breaking type changes I wanna make 🧑‍🍳

@justlevine yes please! 🙏🏻

@jasonbahl jasonbahl merged commit fc28f29 into wp-graphql:develop Apr 22, 2025
35 checks passed
@justlevine justlevine deleted the chore/native-return-types branch April 22, 2025 22:22
pull bot pushed a commit to Zezo-Ai/wp-graphql that referenced this pull request Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs: reviewer response This needs the attention of a codeowner or maintainer 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