Re: Autoboxing in php 5.1
| From: | Greg Beaver | Date: | Sun, 13 Feb 2005 15:44:37 +0000 |
| Subject: | Re: Autoboxing in php 5.1 | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-14904@lists.php.net to get a copy of this message | ||
Marcus Boerger wrote:
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 cellog@php.net * * For more information see {@link http://www.phpdoc.org phpDocumentor website} * @author Greg Beaver <cellog@php.net> * @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