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

[9.x] Fix PHPStan description of Closure returning a union type #47352

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

ondrejmirtes
Copy link
Contributor

I changed Closure and callable type description in PHPStan 1.10.16 to be compatible with what you can write in PHPDoc (https://phpstan.org/writing-php-code/phpdoc-types#callables). Union types need to be put in parentheses, because without them callable(): string|null means (callable(): string)|null.

This breaks tests in laravel/framework so I'm sending a PR to fix them.

I wasn't sure which branch to pick. I chose 9.x because I figured it'll get merged to 10.x too (where the same issue is present).

Cheers 👍

Copy link
Member

@driesvints driesvints left a comment

Choose a reason for hiding this comment

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

Hey @ondrejmirtes. 9.x is fine, thank you!

@driesvints driesvints changed the title Fix PHPStan description of Closure returning a union type [9.x] Fix PHPStan description of Closure returning a union type Jun 5, 2023
@driesvints driesvints merged commit 5deb049 into laravel:9.x Jun 5, 2023
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