talira

ReflectionDocBlock

DocBlock parser for PHP, from phpDocumentor

open sourceMITfree

ReflectionDocBlock is the DocBlock parser component of phpDocumentor, compatible with the PHPDoc standard. A library uses it to read annotations and other information embedded in PHP DocBlocks: a DocBlockFactory parses a comment (or any object with a getDocComment() method, such as ReflectionClass) into a DocBlock object whose summary, description and tags can be queried or rendered back to text.

Problems it solves

  • read annotations from PHP docblock comments in my library
  • parse the summary and @tags out of a PHPDoc comment
  • get the @param and @return types written in a PHP docblock

Features

  • parses PHP DocBlocks into summary, description and tags
  • follows the PHPDoc standard
  • reads a comment string or any object with getDocComment(), such as ReflectionClass
  • renders a parsed description back to text