mirror of
https://github.com/danog/psalm.git
synced 2024-12-02 17:52:45 +01:00
Fixes
This commit is contained in:
parent
c80221344b
commit
59ab73fa91
@ -957,7 +957,8 @@ class ForeachAnalyzer
|
||||
): void {
|
||||
if ($iterator_atomic_type instanceof TIterable
|
||||
|| ($iterator_atomic_type instanceof TGenericObject
|
||||
&& strtolower($iterator_atomic_type->value) === 'traversable')
|
||||
&& strtolower($iterator_atomic_type->value) === 'traversable'
|
||||
&& isset($iterator_atomic_type->type_params[1]))
|
||||
) {
|
||||
$value_type = Type::combineUnionTypes($value_type, $iterator_atomic_type->type_params[1]);
|
||||
$key_type = Type::combineUnionTypes($key_type, $iterator_atomic_type->type_params[0]);
|
||||
|
@ -1246,7 +1246,6 @@ class ArgumentAnalyzer
|
||||
$function_id_parts = explode('&', $function_id);
|
||||
|
||||
$non_existent_method_ids = [];
|
||||
$has_valid_method = false;
|
||||
|
||||
foreach ($function_id_parts as $function_id_part) {
|
||||
[$callable_fq_class_name, $method_name] = explode('::', $function_id_part);
|
||||
@ -1299,12 +1298,10 @@ class ArgumentAnalyzer
|
||||
&& !$codebase->methods->methodExists($call_method_id)
|
||||
) {
|
||||
$non_existent_method_ids[] = $function_id_part;
|
||||
} else {
|
||||
$has_valid_method = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$has_valid_method && !$param_type->hasString() && !$param_type->hasArray()) {
|
||||
if ($non_existent_method_ids && !$param_type->hasString() && !$param_type->hasArray()) {
|
||||
if (MethodAnalyzer::checkMethodExists(
|
||||
$codebase,
|
||||
$non_existent_method_ids[0],
|
||||
|
@ -1116,7 +1116,7 @@ class Analyzer
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array{0:int, 1:int} $mixed_counts
|
||||
* @param list{int, int} $mixed_counts
|
||||
*
|
||||
*/
|
||||
public function setMixedCountsForFile(string $file_path, array $mixed_counts): void
|
||||
|
@ -29,7 +29,7 @@ use const PREG_SET_ORDER;
|
||||
*/
|
||||
class PartialParserVisitor extends PhpParser\NodeVisitorAbstract
|
||||
{
|
||||
/** @var array<int, array{int, int, int, int, int, string}> */
|
||||
/** @var array<int, array{0: int, 1: int, 2: int, 3: int, 4: int, 5: string}> */
|
||||
private $offset_map;
|
||||
|
||||
/** @var bool */
|
||||
|
Loading…
Reference in New Issue
Block a user