Skip to content

Commit

Permalink
Fix getComments
Browse files Browse the repository at this point in the history
  • Loading branch information
zbateson committed Apr 15, 2024
1 parent 22e88fa commit 221649f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Header/AbstractHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ public function getAllParts() : array
public function getComments() : array
{
if ($this->comments === null) {
$this->comments = \array_merge(...\array_map(
fn ($p) => ($p instanceof CommentPart) ? [$p] : $p->getAllComments(),
));
$this->comments = \array_map(fn ($c) => $c->getComment(), \array_merge(...\array_map(
fn ($p) => ($p instanceof CommentPart) ? [$p] : $p->getComments(),
$this->allParts
)));
}
return $this->comments;
}
Expand Down

0 comments on commit 221649f

Please sign in to comment.