Skip to content

allow numeric-strings beeing returned for non-empty-string#1428

Merged
ondrejmirtes merged 2 commits intophpstan:1.7.xfrom
staabm:numeric-vs-non-empty
Jun 16, 2022
Merged

allow numeric-strings beeing returned for non-empty-string#1428
ondrejmirtes merged 2 commits intophpstan:1.7.xfrom
staabm:numeric-vs-non-empty

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented Jun 16, 2022

@staabm staabm marked this pull request as ready for review June 16, 2022 07:27

public function isAcceptedBy(Type $acceptingType, bool $strictTypes): TrinaryLogic
{
if ($acceptingType->isNonEmptyString()->yes()) {
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 tried adding this case in isSubTypeOf() instead, but this made other tests fail. therefore the fix looks like it is right now.

@ondrejmirtes ondrejmirtes merged commit 6696f45 into phpstan:1.7.x Jun 16, 2022
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

@staabm staabm deleted the numeric-vs-non-empty branch June 18, 2022 06:24
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.

numeric-string is non considered non-empty-string

2 participants