diff --git a/CHANGELOG.md b/CHANGELOG.md index 56442966..891c04fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ 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) +- Enh #140: Added support for multiple "since" tags (arogachev) - Bug #240: Fixed a bug when a "virtual" / "magic" property's full description was displayed instead of preview in properties list (arogachev) - Bug #239: Do not show a "virtual" / "magic" methods's full description if it matches short description (arogachev) diff --git a/models/BaseDoc.php b/models/BaseDoc.php index e4480f35..bf032c13 100644 --- a/models/BaseDoc.php +++ b/models/BaseDoc.php @@ -36,7 +36,14 @@ class BaseDoc extends BaseObject public $endLine; public $shortDescription; public $description; + /** + * @var string|null Available since this version. + */ public $since; + /** + * @var array A mapping where keys are versions and values are descriptions. + */ + public $sinceMap = []; public $deprecatedSince; public $deprecatedReason; /** @@ -183,11 +190,19 @@ public function __construct($reflector = null, $context = null, $config = []) $this->tags = $docBlock->getTags(); foreach ($this->tags as $i => $tag) { if ($tag instanceof Since) { - $this->since = $tag->getVersion(); + $description = (string) $tag->getDescription(); + if (!$this->since && !$this->sinceMap && !$description) { + $this->since = $tag->getVersion(); + } + + if ($description) { + $this->sinceMap[$tag->getVersion()] = $description; + } + unset($this->tags[$i]); } elseif ($tag instanceof Deprecated) { $this->deprecatedSince = $tag->getVersion(); - $this->deprecatedReason = $tag->getDescription(); + $this->deprecatedReason = (string) $tag->getDescription(); unset($this->tags[$i]); } elseif ($tag->getName() === 'todo') { $this->todos[] = $tag; diff --git a/templates/bootstrap/assets/css/style.css b/templates/bootstrap/assets/css/style.css index 6979f713..f584c407 100644 --- a/templates/bootstrap/assets/css/style.css +++ b/templates/bootstrap/assets/css/style.css @@ -274,6 +274,12 @@ tr.deprecated th { background: lightpink; } +/* Changelog */ + +.changelog { + border: 1px solid #ddd !important; +} + /* Todos */ .todo { diff --git a/templates/html/views/changelog.php b/templates/html/views/changelog.php new file mode 100644 index 00000000..8f4b1ff6 --- /dev/null +++ b/templates/html/views/changelog.php @@ -0,0 +1,25 @@ + + +sinceMap) { ?> +
Version | +Description | +
---|---|
= $version ?> | += $description ?> | +
- - Source code - -
-
- = $highlighter->highlight('php', $sourceCode)->value ?>
-
- + + Source code + +
+
+ = $highlighter->highlight('php', $sourceCode)->value ?>
+
+