PhpCsFixer\DocBlock\Annotation::remove PHP Method

remove() public method

Remove this annotation by removing all its lines.
public remove ( )
    public function remove()
    {
        foreach ($this->lines as $line) {
            $line->remove();
        }
    }

Usage Example

 /**
  * Remove return void or return null annotations..
  *
  * @param DocBlock   $doc
  * @param Annotation $annotation
  */
 private function fixAnnotation(DocBlock $doc, Annotation $annotation)
 {
     if (1 === preg_match('/@return\\s+(void|null)(?!\\|)/', $doc->getLine($annotation->getStart())->getContent())) {
         $annotation->remove();
     }
 }