Skip to content

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

Merged
driesvints merged 1 commit into
laravel:9.xfrom
ondrejmirtes:fix-phpstan-types
Jun 5, 2023
Merged

[9.x] Fix PHPStan description of Closure returning a union type#47352
driesvints merged 1 commit into
laravel:9.xfrom
ondrejmirtes:fix-phpstan-types

Conversation

@ondrejmirtes

Copy link
Copy Markdown
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 👍

@driesvints driesvints 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.

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