/** * Set the tag name. * * This will also be persisted to the upsteam line and annotation. * * @param string $name */ public function setName($name) { $current = $this->getName(); if ('other' === $current) { throw new \RuntimeException('Cannot set name on unknown tag'); } $this->line->setContent(preg_replace("/@{$current}/", "@{$name}", $this->line->getContent(), 1)); $this->name = $name; }