mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Fix return type space issue
This commit is contained in:
parent
7c261d7d1f
commit
e84586cfaa
@ -520,16 +520,18 @@ class CommentChecker
|
|||||||
/** @var int */
|
/** @var int */
|
||||||
$special_type_width = max($special_type_lengths) + 1;
|
$special_type_width = max($special_type_lengths) + 1;
|
||||||
|
|
||||||
$special_types = count($parsed_doc_comment['specials']);
|
$last_type = null;
|
||||||
|
|
||||||
foreach ($parsed_doc_comment['specials'] as $type => $lines) {
|
foreach ($parsed_doc_comment['specials'] as $type => $lines) {
|
||||||
|
if ($last_type !== null && ($last_type !== 'return' || $type !== 'psalm-return')) {
|
||||||
|
$doc_comment_text .= $left_padding . ' *' . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($lines as $line) {
|
foreach ($lines as $line) {
|
||||||
$doc_comment_text .= $left_padding . ' * @' . str_pad($type, $special_type_width) . $line . PHP_EOL;
|
$doc_comment_text .= $left_padding . ' * @' . str_pad($type, $special_type_width) . $line . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($special_types-- > 1) {
|
$last_type = $type;
|
||||||
$doc_comment_text .= $left_padding . ' *'. PHP_EOL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user