mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
avoid formating useless type (#4651)
This commit is contained in:
parent
ffb0c4ae17
commit
98370b65d7
@ -410,14 +410,14 @@ class Union implements TypeNode
|
||||
$multi_floats = count($this->literal_float_types) > 1;
|
||||
|
||||
foreach ($this->types as $type) {
|
||||
$type_string = $type->toNamespacedString($namespace, $aliased_classes, $this_class, $use_phpdoc_format);
|
||||
|
||||
if ($type instanceof TLiteralInt && !$multi_ints) {
|
||||
$type_string = 'int';
|
||||
} elseif ($type instanceof TLiteralFloat && !$multi_floats) {
|
||||
$type_string = 'float';
|
||||
} elseif ($type instanceof TLiteralString && !$multi_strings) {
|
||||
$type_string = 'string';
|
||||
} else {
|
||||
$type_string = $type->toNamespacedString($namespace, $aliased_classes, $this_class, $use_phpdoc_format);
|
||||
}
|
||||
|
||||
$types[] = $type_string;
|
||||
|
Loading…
x
Reference in New Issue
Block a user