From aa7341719381b5a812381ce1b74522b5b3545e60 Mon Sep 17 00:00:00 2001 From: Alexey Rogachev Date: Mon, 6 Dec 2021 14:38:29 +0600 Subject: [PATCH 1/2] Fixed a bug when a property's full description was displayed instead of preview in properties list --- CHANGELOG.md | 2 ++ models/TypeDoc.php | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20b4ea78..2f766d1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ Yii Framework 2 apidoc extension Change Log - Enh #196: Added support for PHPDoc inline links (arogachev) - Enh #147: Added feature of viewing method source code without external links (arogachev) - Bug #168: Fixed handling of inheritance (arogachev) +- Bug #240: Fixed a bug when a property's full description was displayed instead of preview in properties list +(arogachev) 2.1.6 May 05, 2021 diff --git a/models/TypeDoc.php b/models/TypeDoc.php index ea378551..ba3d6c2b 100644 --- a/models/TypeDoc.php +++ b/models/TypeDoc.php @@ -201,6 +201,8 @@ public function __construct($reflector = null, $context = null, $config = []) } if ($tag instanceof Property || $tag instanceof PropertyRead || $tag instanceof PropertyWrite) { + $shortDescription = $tag->getDescription() ? BaseDoc::extractFirstSentence($tag->getDescription()): ''; + $property = new PropertyDoc(null, $context, [ 'sourceFile' => $this->sourceFile, 'name' => '$' . $tag->getVariableName(), @@ -209,7 +211,7 @@ public function __construct($reflector = null, $context = null, $config = []) 'definedBy' => $this->name, 'type' => (string) $tag->getType(), 'types' => $this->splitTypes($tag->getType()), - 'shortDescription' => $tag->getDescription(), + 'shortDescription' => $shortDescription, 'description' => $tag->getDescription(), ]); From c958b7fddbd6cfc00807cccedd5965dffaaa89e5 Mon Sep 17 00:00:00 2001 From: Alexey Rogachev Date: Mon, 6 Dec 2021 17:18:21 +0600 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f766d1f..12b23ead 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,8 +25,8 @@ Yii Framework 2 apidoc extension Change Log - Enh #196: Added support for PHPDoc inline links (arogachev) - Enh #147: Added feature of viewing method source code without external links (arogachev) - Bug #168: Fixed handling of inheritance (arogachev) -- Bug #240: Fixed a bug when a property's full description was displayed instead of preview in properties list -(arogachev) +- Bug #240: Fixed a bug when a "virtual" / "magic" property's full description was displayed instead of preview in +- properties list (arogachev) 2.1.6 May 05, 2021