mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
DocBlock: add removeTag() method
This commit is contained in:
committed by
Jaap van Otterdijk
parent
14f9edf1ae
commit
c62f4592a0
@@ -217,4 +217,21 @@ final class DocBlock
|
||||
{
|
||||
$this->tags[] = $tag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a tag from this DocBlock.
|
||||
*
|
||||
* @param Tag $tag The tag to remove.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function removeTag(Tag $tagToRemove)
|
||||
{
|
||||
foreach ($this->tags as $key => $tag) {
|
||||
if ($tag === $tagToRemove) {
|
||||
unset($this->tags[$key]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user