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

Describe all callable arguments with types for Promise and Deferred #253

Merged
merged 2 commits into from
Sep 11, 2023

Conversation

clue
Copy link
Member

@clue clue commented Sep 9, 2023

This changeset describes all callable arguments with types for Promise and Deferred. In particular, this makes it easier to detect incorrect usage using static analysis, such as when omitting required arguments as discussed in #213 and #138.

Builds on top of #247, #246 and others
Closes #252

@stof
Copy link

stof commented Sep 11, 2023

I suggest adding checkMissingCallableSignature: true in the phpstan config, so that it reports missing callable signatures.

@clue
Copy link
Member Author

clue commented Sep 11, 2023

I suggest adding checkMissingCallableSignature: true in the phpstan config, so that it reports missing callable signatures.

Go ahead, PRs welcome 👍 Tested this out locally and appears to report a number of low-priority types for internal functions and tests only, but happy to consider this if the changeset is reasonable 👍

@stof
Copy link

stof commented Sep 11, 2023

I'll let you merge this PR first then, so that those types are already defined.

Copy link
Member

@SimonFrings SimonFrings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@WyriHaximus WyriHaximus merged commit 5cd1458 into reactphp:3.x Sep 11, 2023
13 checks passed
@clue clue deleted the callable-types branch September 11, 2023 14:35
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.

Arguments expecting callables should describe the full signature of callables
5 participants