mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix Psalm issues
This commit is contained in:
parent
1a48be8e9c
commit
648dda67ed
@ -348,9 +348,12 @@ class ArrayFetchAnalyzer
|
||||
|
||||
if ($in_assignment) {
|
||||
$offset_type->removeType('null');
|
||||
|
||||
if (!$offset_type->ignore_nullable_issues) {
|
||||
$offset_type->addType(new TLiteralInt(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($array_type->getTypes() as $type_string => $type) {
|
||||
$original_type = $type;
|
||||
|
@ -269,7 +269,7 @@ class Populator
|
||||
$declaring_class_storages = [];
|
||||
|
||||
foreach ($overridden_method_ids as $declaring_method_id) {
|
||||
list($declaring_class, $declaring_method_name) = explode('::', $declaring_method_id);
|
||||
list($declaring_class) = explode('::', $declaring_method_id);
|
||||
$declaring_class_storage
|
||||
= $declaring_class_storages[$declaring_class]
|
||||
= $this->classlike_storage_provider->get($declaring_class);
|
||||
|
@ -1117,7 +1117,7 @@ class ArrayAssignmentTest extends TestCase
|
||||
return $array;
|
||||
}',
|
||||
],
|
||||
'coerceNullKeyToZero' => [
|
||||
'coercePossiblyNullKeyToZero' => [
|
||||
'<?php
|
||||
function int_or_null(): ?int {
|
||||
return rand(0, 1) !== 0 ? 42 : null;
|
||||
|
Loading…
Reference in New Issue
Block a user