Skip to content

Conversation

@VincentLanglet
Copy link
Contributor

No description provided.


**default**: `false`

PHPStan has defined some benevolent union types. Those unions are not checked by the `checkUnionTypes` option enabled on level 7:
Copy link
Contributor

Choose a reason for hiding this comment

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

does the documentation mention anywhere what a "benevolent union type" actually is? if so it would be great to link to it here.

Copy link
Contributor

@mad-briller mad-briller Oct 28, 2022

Choose a reason for hiding this comment

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

you should always prefer active voice when writing documentation:
https://www.grammarly.com/blog/active-vs-passive-voice/

Suggested change
PHPStan has defined some benevolent union types. Those unions are not checked by the `checkUnionTypes` option enabled on level 7:
PHPStan defines some benevolent union types, such as `array-key`. Benevolent unions are ignored by the `checkUnionTypes` option enabled on level 7:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

does the documentation mention anywhere what a "benevolent union type" actually is? if so it would be great to link to it here.

There is none

Copy link
Contributor

@herndlm herndlm Oct 28, 2022

Choose a reason for hiding this comment

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

this is one of the big open mysteries :D the best we have so far is this #6440
I think it's a bit hard to understand and get and therefore mostly an internal thing to avoid annoyances

but, yeah, with this documentation it's not so internal anymore I guess :) so maybe somebody can describe them somehow

@ondrejmirtes ondrejmirtes merged commit 8562844 into phpstan:1.9.x Nov 2, 2022
@ondrejmirtes
Copy link
Member

Thank you.

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.

4 participants