Add methods to docblock builder

This commit is contained in:
Barry vd. Heuvel
2024-02-19 09:31:57 +01:00
parent c223665e99
commit 9d2c95e338
+21
View File
@@ -81,6 +81,10 @@ class DocBlockBuilder
$this->description = $description;
}
public function getContext()
{
return $this->context;
}
public function getTags()
{
return $this->tags;
@@ -95,6 +99,7 @@ class DocBlockBuilder
public function hasTag(string $name): bool
{
/** @var Tag $tag */
foreach ($this->tags as $tag) {
if ($tag->getName() === $name) {
return true;
@@ -104,6 +109,22 @@ class DocBlockBuilder
return false;
}
public function getTagsByName($name)
{
$result = [];
/** @var Tag $tag */
foreach ($this->tags as $tag) {
if ($tag->getName() != $name) {
continue;
}
$result[] = $tag;
}
return $result;
}
public function appendTag(Tag $tag)
{
$this->tags[] = $tag;