Skip to content

Commit ede4a0f

Browse files
author
Kirill Nesmeyanov
committed
Improve link/see tags behaviour
1 parent 3a28f04 commit ede4a0f

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/Description/DescriptionFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function create(string $contents): Description
4848
$description .= $this->escapeDescriptionChunk($chunk);
4949
}
5050

51-
return new Description($description, $tags);
51+
return new Description(\trim($description), $tags);
5252
}
5353

5454
/**

src/DocBlock/Description.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(
2626

2727
public static function create(string $body): self
2828
{
29-
return new self($body);
29+
return new self(\trim($body));
3030
}
3131

3232
/**

src/DocBlock/Reader/ReferenceReader.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ private function tryParseClassConst(string $body): ?ClassConstReference
110110

111111
private function tryParseNameReference(string $body): ?NameReference
112112
{
113+
if (\ctype_alpha(\str_replace('\\', '', $body))) {
114+
if (\str_starts_with($body, '\\')) {
115+
return new NameReference(new FullQualifiedName($body));
116+
}
117+
118+
return new NameReference(new Name($body));
119+
}
120+
113121
return null;
114122
}
115123

0 commit comments

Comments
 (0)