mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Fix Psalm issues
This commit is contained in:
parent
1a48be8e9c
commit
648dda67ed
@ -348,7 +348,10 @@ class ArrayFetchAnalyzer
|
||||
|
||||
if ($in_assignment) {
|
||||
$offset_type->removeType('null');
|
||||
$offset_type->addType(new TLiteralInt(0));
|
||||
|
||||
if (!$offset_type->ignore_nullable_issues) {
|
||||
$offset_type->addType(new TLiteralInt(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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