src/ClassGeneration/DocBlock/TagCollection.php
public function add($tag)
    {
        if (!$tag instanceof TagInterface) {
            throw new \InvalidArgumentException('This tag is not allowed');
        }
        if ($this->isUniqueTag($tag->getName())) {
            $this->removeByName($tag->getName());
        }

        return parent::add($tag);
    }
public function add($tag)
    {
        if (!$tag instanceof TagInterface) {
            throw new \InvalidArgumentException('This tag is not allowed');
        }
        if ($this->isUniqueTag($tag->getName())) {
            $this->removeByName($tag->getName());
        }

        return parent::add($tag);
    }
public function add ( $ tag ) { if ( ! $ tag instanceof TagInterface ) { throw new \ InvalidArgumentException ( 'This tag is not allowed' ) ; } if ( $ this -> isUniqueTag ( $ tag -> getName ( ) ) ) { $ this -> removeByName ( $ tag -> getName ( ) ) ; } return parent :: add ( $ tag ) ; }
Adds a new Tag on Dockblock.

@param TagInterface $tag

@throws \InvalidArgumentException
@return bool
Adds a new Tag on Dockblock .