From e3d6818033bc9e96232bcc165c1e6e9ca236fe33 Mon Sep 17 00:00:00 2001 From: Anton Date: Sat, 18 Dec 2021 21:35:58 +0300 Subject: [PATCH] Optimize Description::render() --- src/DocBlock/Description.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/DocBlock/Description.php b/src/DocBlock/Description.php index a31b2892..ae53d5fc 100644 --- a/src/DocBlock/Description.php +++ b/src/DocBlock/Description.php @@ -93,6 +93,10 @@ public function getTags(): array */ public function render(?Formatter $formatter = null): string { + if ($this->tags === []) { + return $this->bodyTemplate; + } + if ($formatter === null) { $formatter = new PassthroughFormatter(); }