Skip to content

Commit

Permalink
Make Psalm happy
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Mar 30, 2020
1 parent 8f98135 commit 9074932
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions hooks/TestCaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,15 +413,17 @@ function (
}
}

/** @return Type\Atomic[] */
/** @return non-empty-array<string,Type\Atomic> */
private static function getAtomics(Type\Union $union): array
{
if (method_exists($union, 'getAtomicTypes')) {
/** @var Type\Atomic[] annotated for versions missing the method */
/** @var non-empty-array<string, Type\Atomic> annotated for versions missing the method */
return $union->getAtomicTypes();
} else {
/** @psalm-suppress DeprecatedMethod annotated for newer versions that deprecated the method */
return $union->getTypes();
$types = $union->getTypes();
assert(!empty($types));
return $types;
}
}

Expand Down Expand Up @@ -454,13 +456,6 @@ private static function unionizeIterables(Codebase $codebase, Type\Union $iterab
}
}

if (empty($key_types) || empty($value_types)) {
return new Type\Atomic\TIterable([
Type::getMixed(),
Type::getMixed(),
]);
}

$combine =
/** @param null|Type\Union $a */
function ($a, Type\Union $b) use ($codebase): Type\Union {
Expand Down

0 comments on commit 9074932

Please sign in to comment.