Hi folks,
I'm looking for some method of converting a PHP Docblock (as used for generating documentation by tools like Doxygen) into a structure I can inspect in PHP.
For example, I want to parse the following lines:
/**
* Multiply two values
* @CHECKME
*
* @author someone
* @created eons ago
*
* @param integer $x
* @param integer $x
*
* @return integer
*/
function multiply($x, $y)
{
return $x * $y;
}
Into something similar to:
array(
'author' => 'someone'
,'created' => 'eons ago'
,'param' => array(
'integer $x'
,'integer $y'
)
,'_flags' => array(
'@CHECKME'
)
);
I explicitly cannot use PEAR or any such library, it has to be relatively standalone. Any given solution that is better than using a bunch of regexes after stripping away comment outline would be awesome.