mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 10:07:12 +00:00
Add methods to docblock builder
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user