Skip to content
Permalink
Browse files

Revert "Coerce value with array-offset to array|ArrayAccess"

This reverts commit a8a67bc.
  • Loading branch information...
muglug committed Aug 7, 2019
1 parent a8a67bc commit b5eb63bb2d002b23bc83956ddc36b646fb4b271a
Showing with 0 additions and 17 deletions.
  1. +0 −4 src/Psalm/Type/Reconciler.php
  2. +0 −13 tests/ArrayAccessTest.php
@@ -125,10 +125,6 @@ public static function reconcileKeyedTypes(
$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 @@ function dispatch(array $params) : void {
/** @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 [];
}'
],
];
}

0 comments on commit b5eb63b

Please sign in to comment.
You can’t perform that action at this time.