1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Fix #831 - ignore falsable issues when getting callmap function params

This commit is contained in:
Matthew Brown 2018-06-20 09:09:03 -04:00
parent 896790d30c
commit 4688cf7a92
2 changed files with 14 additions and 1 deletions

View File

@ -1016,7 +1016,13 @@ abstract class FunctionLikeChecker extends SourceChecker implements StatementsSo
continue;
}
if (TypeChecker::isContainedBy($project_checker->codebase, $arg->value->inferredType, $param_type)) {
if (TypeChecker::isContainedBy(
$project_checker->codebase,
$arg->value->inferredType,
$param_type,
$arg->value->inferredType->ignore_nullable_issues,
$arg->value->inferredType->ignore_falsable_issues
)) {
continue;
}

View File

@ -694,6 +694,13 @@ class FunctionCallTest extends TestCase
'$h' => 'array<mixed, mixed>',
],
],
'strstrWithPossiblyFalseFirstArg' => [
'<?php
strtr(
file_get_contents("foobar.txt"),
["foo" => "bar"]
);'
],
];
}