mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-20 11:03:09 +00:00
Add methods to docblock builder
This commit is contained in:
@@ -81,6 +81,10 @@ class DocBlockBuilder
|
|||||||
$this->description = $description;
|
$this->description = $description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getContext()
|
||||||
|
{
|
||||||
|
return $this->context;
|
||||||
|
}
|
||||||
public function getTags()
|
public function getTags()
|
||||||
{
|
{
|
||||||
return $this->tags;
|
return $this->tags;
|
||||||
@@ -95,6 +99,7 @@ class DocBlockBuilder
|
|||||||
|
|
||||||
public function hasTag(string $name): bool
|
public function hasTag(string $name): bool
|
||||||
{
|
{
|
||||||
|
/** @var Tag $tag */
|
||||||
foreach ($this->tags as $tag) {
|
foreach ($this->tags as $tag) {
|
||||||
if ($tag->getName() === $name) {
|
if ($tag->getName() === $name) {
|
||||||
return true;
|
return true;
|
||||||
@@ -104,6 +109,22 @@ class DocBlockBuilder
|
|||||||
return false;
|
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)
|
public function appendTag(Tag $tag)
|
||||||
{
|
{
|
||||||
$this->tags[] = $tag;
|
$this->tags[] = $tag;
|
||||||
|
|||||||
Reference in New Issue
Block a user