1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Fix #915 - never care about falsable/nullable issues when matching functions from callmap

This commit is contained in:
Matthew Brown 2018-08-08 23:28:30 -04:00
parent b9018a4a03
commit abc19d7136
2 changed files with 12 additions and 7 deletions

View File

@ -1058,8 +1058,8 @@ abstract class FunctionLikeChecker extends SourceChecker implements StatementsSo
$project_checker->codebase,
$arg->value->inferredType,
$param_type,
$arg->value->inferredType->ignore_nullable_issues,
$arg->value->inferredType->ignore_falsable_issues
true,
true
)) {
continue;
}

View File

@ -694,12 +694,17 @@ class FunctionCallTest extends TestCase
'$h' => 'array<mixed, mixed>',
],
],
'strstrWithPossiblyFalseFirstArg' => [
'strtrWithPossiblyFalseFirstArg' => [
'<?php
strtr(
file_get_contents("foobar.txt"),
["foo" => "bar"]
);'
/**
* @param string|false $str
* @param array<string, string> $replace_pairs
* @return string
*/
function strtr_wrapper($str, array $replace_pairs) {
/** @psalm-suppress PossiblyFalseArgument */
return strtr($str, $replace_pairs);
}',
],
'splatArrayIntersect' => [
'<?php