Skip to content

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

Merged
WyriHaximus merged 2 commits into
reactphp:3.xfrom
clue-labs:callable-types
Sep 11, 2023
Merged

Describe all callable arguments with types for Promise and Deferred#253
WyriHaximus merged 2 commits into
reactphp:3.xfrom
clue-labs:callable-types

Conversation

@clue

@clueclue commented Sep 9, 2023

Copy link
Copy Markdown
Member

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

stof commented Sep 11, 2023

Copy link
Copy Markdown

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

@clue

clue commented Sep 11, 2023

Copy link
Copy Markdown
MemberAuthor

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

stof commented Sep 11, 2023

Copy link
Copy Markdown

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

@SimonFringsSimonFrings left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@WyriHaximusWyriHaximus left a comment

Copy link
Copy Markdown
Member

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.xSep 11, 2023
@clue
clue deleted the callable-types branch September 11, 2023 14:35
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

@clue@stof@WyriHaximus@stylder@SimonFrings