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:
parent
8faa36c1cf
commit
fe46e4e63d
@ -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(
|
||||
|
@ -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
|
||||
);
|
||||
}',
|
||||
],
|
||||
];
|
||||
|
@ -508,6 +508,7 @@ class FunctionCallTest extends TestCase
|
||||
'assertions' => [],
|
||||
'error_levels' => [
|
||||
'MissingClosureParamType',
|
||||
'MixedTypeCoercion',
|
||||
],
|
||||
],
|
||||
'arrayFilterGoodArgs' => [
|
||||
|
Loading…
x
Reference in New Issue
Block a user