mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Revert "Coerce value with array-offset to array|ArrayAccess"
This reverts commit a8a67bc7e7
.
This commit is contained in:
parent
a8a67bc7e7
commit
b5eb63bb2d
@ -125,10 +125,6 @@ class Reconciler
|
||||
$new_base_key = $base_key . '[' . $array_key . ']';
|
||||
|
||||
if (strpos($array_key, '\'') !== false) {
|
||||
if (!isset($existing_types[$base_key])) {
|
||||
$new_types[$base_key][] = ['~array', '~ArrayAccess'];
|
||||
}
|
||||
|
||||
$new_types[$base_key][] = ['!string'];
|
||||
$new_types[$base_key][] = ['!=falsy'];
|
||||
}
|
||||
|
@ -528,19 +528,6 @@ class ArrayAccessTest extends TestCase
|
||||
/** @psalm-suppress MixedPropertyFetch */
|
||||
print_r([&$a->foo->bar]);',
|
||||
],
|
||||
'coerceAfterIsset' => [
|
||||
'<?php
|
||||
/**
|
||||
* @return array|ArrayAccess
|
||||
*/
|
||||
function getBar(array $array) {
|
||||
if (isset($array["foo"]["bar"])) {
|
||||
return $array["foo"];
|
||||
}
|
||||
|
||||
return [];
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user