Skip to content

Commit 489b48b

Browse files
committed
cleanup logic
1 parent 592910d commit 489b48b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

dev/src/DocFx/Node/ParameterNode.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ private function resolveNestedType(string $name): string
129129
));
130130
}
131131

132-
$altarray = '[]' === substr($name, -2);
133-
if ($altarray || 0 === strpos($name, 'array<')) {
132+
if ('[]' === substr($name, -2)) {
133+
return $this->resolveNestedType(substr($name, 0, -2)) . '[]';
134+
}
135+
136+
if (0 === strpos($name, 'array<')) {
134137
return preg_replace_callback(
135138
'/^array<([^ ]*)>$/',
136-
function ($matches) use ($altarray) {
137-
$type = $this->resolveNestedType($matches[1]);
138-
return $altarray ? $type . '[]' : sprintf('array<%s>', $type);
139-
},
139+
fn ($m) => sprintf('array<%s>', $this->resolveNestedType($m[1])),
140140
$name
141141
);
142142
}

0 commit comments

Comments
 (0)