Hello Adam,
ok, you propose a function to prepare the doc comments for further processing. While this seems a good idea at first glance it is not that easy as you typed it. The problem is that there are different tags some of which stop at the next tag, some are just valid for the word, some are valid for the current line and some are valid for a pragraph. Thus it is better to provide an extension for that. And i think it would be a good idea to start this as a set of php scripts.
Agreed - don't forget, this is a valid docblock in phpDocumentor:
/**
* Send an email to [EMAIL PROTECTED]
*
* For more information see [EMAIL PROTECTED] http://www.phpdoc.org phpDocumentor website}
* @author Greg Beaver <[EMAIL PROTECTED]>
* @param int Hello
* @param string $var thingy
* @return boolean
*/
The regex solution would capture:
@php.net @link @author @php.net (again) @param @param @return
Marcus is right. As the person who has been working on auto-documenting solutions for the past several years, it is hardly a simple task to parse documentation out of a file. However, if there was a way to access *all* of the docblocks in a file using reflection, that would be a VERY useful thing.
Is it difficult to provide a reflection class for an entire file, ReflectionFile? This could have getDocComments() which would simply return the raw doc comments indexed by line number.
I can understand if this is too difficult under current design choices, but it would make my job much easier in recoding phpDocumentor for fancy PHP5 self-documenting, as we use docblocks to document include/require statements, defines, class constants and also global variables. Reflection is almost powerful enough to do this task.
Greg
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php