mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Flesh out callmap type
This commit is contained in:
parent
2ebf6a0ef5
commit
45eaea1ed9
@ -986,6 +986,13 @@ class CallChecker
|
|||||||
$return_type_candidate = Type::getString();
|
$return_type_candidate = Type::getString();
|
||||||
} elseif (FunctionChecker::inCallMap($cased_method_id)) {
|
} elseif (FunctionChecker::inCallMap($cased_method_id)) {
|
||||||
$return_type_candidate = FunctionChecker::getReturnTypeFromCallMap($method_id);
|
$return_type_candidate = FunctionChecker::getReturnTypeFromCallMap($method_id);
|
||||||
|
|
||||||
|
$return_type_candidate = ExpressionChecker::fleshOutType(
|
||||||
|
$project_checker,
|
||||||
|
$return_type_candidate,
|
||||||
|
$fq_class_name,
|
||||||
|
$method_id
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
if (MethodChecker::checkMethodVisibility(
|
if (MethodChecker::checkMethodVisibility(
|
||||||
$method_id,
|
$method_id,
|
||||||
|
@ -74,9 +74,12 @@ class MethodCallTest extends TestCase
|
|||||||
final class MyDate extends DateTimeImmutable {}
|
final class MyDate extends DateTimeImmutable {}
|
||||||
|
|
||||||
$today = new MyDate();
|
$today = new MyDate();
|
||||||
$yesterday = $today->sub(new DateInterval("P1D"));',
|
$yesterday = $today->sub(new DateInterval("P1D"));
|
||||||
|
|
||||||
|
$b = (new DateTimeImmutable())->modify("+3 hours");',
|
||||||
'assertions' => [
|
'assertions' => [
|
||||||
'$yesterday' => 'MyDate',
|
'$yesterday' => 'MyDate',
|
||||||
|
'$b' => 'DateTimeImmutable',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user