1
0
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:
Brown 2019-09-25 13:12:29 -04:00
parent 1a48be8e9c
commit 648dda67ed
3 changed files with 6 additions and 3 deletions

View File

@ -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));
}
}
}

View File

@ -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);

View File

@ -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;