1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Make tests a bit more specific

This commit is contained in:
Matt Brown 2018-04-10 15:47:04 -04:00
parent 8faa36c1cf
commit fe46e4e63d
3 changed files with 29 additions and 18 deletions

View File

@ -145,11 +145,11 @@ class IfChecker
$newish_var_ids = array_map(
/**
* @param mixed $_
* @param Type\Union $_
*
* @return true
*/
function ($_) {
function (Type\Union $_) {
return true;
},
array_diff_key(

View File

@ -440,12 +440,17 @@ class CallableTest extends TestCase
function f(array $ret) : array
{
return array_map(
/**
* @param array{0:string,1:string} $row
*/
function (array $row) {
return [
strval($row[0]),
intval($row[1]),
];
}, $ret);
},
$ret
);
}',
'assertions' => [],
'error_levels' => ['MissingClosureReturnType'],
@ -459,12 +464,17 @@ class CallableTest extends TestCase
function f(array $ret): array
{
return array_map(
/**
* @param array{0:string,1:string} $row
*/
function (array $row): array {
return [
strval($row[0]),
intval($row[1]),
];
}, $ret);
},
$ret
);
}',
],
];

View File

@ -508,6 +508,7 @@ class FunctionCallTest extends TestCase
'assertions' => [],
'error_levels' => [
'MissingClosureParamType',
'MixedTypeCoercion',
],
],
'arrayFilterGoodArgs' => [