Skip to content

Commit

Permalink
cs-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Dec 7, 2023
1 parent dbded43 commit 6650bd8
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/Psalm/Type/Reconciler.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,12 @@ public static function reconcileKeyedTypes(
if ($type_changed || $failed_reconciliation) {
$changed_var_ids[$key] = true;

if (substr($key, -1) === ']' && !$has_inverted_isset && !$has_inverted_key_exists && !$has_empty && !$is_equality) {
if (substr($key, -1) === ']'
&& !$has_inverted_isset
&& !$has_inverted_key_exists
&& !$has_empty
&& !$is_equality
) {
self::adjustTKeyedArrayType(
$key_parts,
$existing_types,
Expand Down Expand Up @@ -728,11 +733,17 @@ private static function getValueForKey(

$new_base_type_candidate = $existing_key_type_part->type_params[1];

if ($new_base_type_candidate->isMixed() && !$has_isset && !$has_inverted_isset && !$has_inverted_key_exists) {
if ($new_base_type_candidate->isMixed()
&& !$has_isset
&& !$has_inverted_isset
&& !$has_inverted_key_exists
) {
return $new_base_type_candidate;
}

if (($has_isset || $has_inverted_isset || $has_inverted_key_exists) && isset($new_assertions[$new_base_key])) {
if (($has_isset || $has_inverted_isset || $has_inverted_key_exists)
&& isset($new_assertions[$new_base_key])
) {
if ($has_inverted_isset && $new_base_key === $key) {
$new_base_type_candidate = $new_base_type_candidate->getBuilder();
$new_base_type_candidate->addType(new TNull);
Expand Down

0 comments on commit 6650bd8

Please sign in to comment.