Skip to content

Commit b82fd99

Browse files
staabmphpstan-bot
authored andcommitted
Prevent unnecessary work in UnionType->describe()
1 parent 391dcec commit b82fd99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)