Skip to content

Commit 9b08619

Browse files
Allow deleting tags in DocBlocks
1 parent 3dcbd98 commit 9b08619

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Barryvdh/Reflection/DocBlock.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,23 @@ public function appendTag(Tag $tag)
439439
return $tag;
440440
}
441441

442+
/**
443+
* Deletes a tag from the list of tags.
444+
*
445+
* @param Tag $tag The tag to be deleted.
446+
*
447+
* @return bool True if the tag was deleted.
448+
*/
449+
public function deleteTag(Tag $tag)
450+
{
451+
if (($key = array_search($tag, $this->tags)) !== false) {
452+
unset($this->tags[$key]);
453+
454+
return true;
455+
}
456+
457+
return false;
458+
}
442459

443460
/**
444461
* Builds a string representation of this object.

0 commit comments

Comments
 (0)