Skip to content

Fix IntegerRange-FloatType subtype detection #1048

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Type/IntegerRangeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function isSuperTypeOf(Type $type): TrinaryLogic
return TrinaryLogic::createMaybe();
}

if ($type instanceof parent) {
if ($type instanceof parent || $type instanceof FloatType) {
return TrinaryLogic::createMaybe();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,6 @@ public function testStrictComparison(): void
'Strict comparison using === between 0 and 0 will always evaluate to true.',
426,
],
[
'Strict comparison using === between (int<min, 0>|int<2, max>|string) and 1.0 will always evaluate to false.',
464,
],
[
'Strict comparison using === between (int<min, 0>|int<2, max>|string) and stdClass will always evaluate to false.',
466,
Expand Down Expand Up @@ -332,10 +328,6 @@ public function testStrictComparisonWithoutAlwaysTrue(): void
'Strict comparison using !== between null and null will always evaluate to false.',
408,
],
[
'Strict comparison using === between (int<min, 0>|int<2, max>|string) and 1.0 will always evaluate to false.',
464,
],
[
'Strict comparison using === between (int<min, 0>|int<2, max>|string) and stdClass will always evaluate to false.',
466,
Expand Down