Skip to content

Commit 9b4ecd5

Browse files
committed
Prevent unnecessary work in UnionType->describe()
1 parent d462113 commit 9b4ecd5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Type/UnionType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public function describe(VerbosityLevel $level): string
329329
} elseif ($type instanceof IntersectionType) {
330330
$intersectionDescription = $type->describe($level);
331331
if (str_contains($intersectionDescription, '&')) {
332-
$typeNames[] = sprintf('(%s)', $type->describe($level));
332+
$typeNames[] = sprintf('(%s)', $intersectionDescription);
333333
} else {
334334
$typeNames[] = $intersectionDescription;
335335
}

0 commit comments

Comments
 (0)