Skip to content
Merged
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/ResourceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function toInteger(): Type

public function toFloat(): Type
{
return new ErrorType();
return new FloatType();
}

public function toArray(): Type
Expand Down
6 changes: 3 additions & 3 deletions tests/PHPStan/Rules/Cast/InvalidCastRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ public function testRule(): void
],
[
'Cannot cast object to string.',
35,
36,
],
[
'Cannot cast Test\\Foo to string.',
41,
42,
],
[
'Cannot cast array|float|int to string.',
48,
49,
],
]);
}
Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Rules/Cast/data/invalid-cast.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function (

(string) fopen('php://memory', 'r');
(int) fopen('php://memory', 'r');
(float) fopen('php://memory', 'r');
};

function (
Expand Down
Loading