Skip to content

A few missing closure signatures - #6901

Open
AJenbo wants to merge 1 commit into
phpstan:2.3.xfrom
AJenbo:small-types
Open

AJenbo wants to merge 1 commit into
phpstan:2.3.xfrom
AJenbo:small-types

Conversation

@AJenbo

@AJenbo AJenbo commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Just adding a few missing types, should be the last of the type clean up for now.

Comment on lines +258 to 262
/**
* @param callable(bool): Type $left
* @param callable(bool): Type $right
*/
$andVerdict = static fn (callable $left, callable $right): callable => static function (bool $nativeTypesPromoted) use ($left, $right): Type {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm unsure such phpdoc for closure

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I'm not sure I understand what you mean. Could you please clarify?

@VincentLanglet VincentLanglet Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See https://phpstan.org/r/8a0dae54-39f1-4eb2-aed9-552a80b9fc80

The phpdoc is not used.

  • No type inference
  • No error reported

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's an unrelated issue I would say

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the phpdoc is not used at all, it's useless to add it here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm happy to add support for it as well if that's desired, but I think that should go in a separate PR.

@AJenbo AJenbo changed the title A few minor type clean ups A few missing clusure signatures Nov 1, 2026
@AJenbo AJenbo changed the title A few missing clusure signatures A few missing closure signatures Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants