1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 13:51:54 +01:00

feature: add Union#allFloatLiterals as it was missing

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
This commit is contained in:
Maximilian Bösing 2022-06-12 02:50:48 +02:00
parent e13268f5c0
commit 4068f5cbb0
No known key found for this signature in database
GPG Key ID: 9A8988C93CEC81A3

View File

@ -1267,6 +1267,17 @@ final class Union implements TypeNode
return true; return true;
} }
public function allFloatLiterals(): bool
{
foreach ($this->types as $atomic_key_type) {
if (!$atomic_key_type instanceof TLiteralFloat) {
return false;
}
}
return true;
}
public function allLiterals(): bool public function allLiterals(): bool
{ {
foreach ($this->types as $atomic_key_type) { foreach ($this->types as $atomic_key_type) {