1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 09:37:59 +01:00
This commit is contained in:
Daniil Gentili 2022-11-29 17:43:27 +01:00
parent e821109343
commit 2b0e979ee9

View File

@ -52,6 +52,7 @@ use Psalm\Issue\NullReference;
use Psalm\Issue\PossiblyInvalidArrayAccess;
use Psalm\Issue\PossiblyNullArrayAccess;
use Psalm\Issue\PossiblyUndefinedArrayOffset;
use Psalm\Issue\PossiblyUndefinedIntArrayOffset;
use Psalm\Issue\ReferenceConstraintViolation;
use Psalm\Issue\ReferenceReusedFromConfusingScope;
use Psalm\Issue\UnnecessaryVarAnnotation;
@ -1417,13 +1418,15 @@ class AssignmentAnalyzer
&& $assign_value_atomic_type->is_list
&& $assign_value_atomic_type->fallback_params
) {
IssueBuffer::maybeAdd(
new PossiblyUndefinedArrayOffset(
'Possibly undefined array key',
new CodeLocation($statements_analyzer->getSource(), $var)
),
$statements_analyzer->getSuppressedIssues()
);
if ($codebase->config->ensure_array_int_offsets_exist) {
IssueBuffer::maybeAdd(
new PossiblyUndefinedIntArrayOffset(
'Possibly undefined array key',
new CodeLocation($statements_analyzer->getSource(), $var)
),
$statements_analyzer->getSuppressedIssues()
);
}
$new_assign_type =
$assign_value_atomic_type->fallback_params[1];