0

First off, I'm not asking about how to generate documentation FROM PHP source. That's easy enough with libraries like Doxygen or PHPDocumentor. What I'm looking for is a way to automatically generate inline phpdoc-based comment stubs for classes, methods, properties, etc. Are there any pre-existing libraries out there that can do this? I've done a bit of searching and have come up with nothing.

I'm only asking because I have an itch I wanna scratch by writing my own. I tend to spend HOURS at a time churning out code, saving documentation as a last step (I know, I should really do it AS I go). The problem is, even while realizing the importance of inline documentation, after 8 straight hours of coding and writing a dozen classes with dozens of methods and properties, it's a bit off-putting to have to screech to a halt and start writing the stuff.

Obviously, I can't create COMPLETE documentation automatically. Things like verbose descriptions of classes, properties and methods have to be hand-typed. But, using reflection, I can easily derive enough information to create comment stubs with fill-in-the-blank placeholders.

If anyone can assist me in the search for a solution like this, AWESOME. If not, I'll get to creating a new Github repository and contribute something useful to the community. :)

Wilhelm Murdoch
  • 1,806
  • 1
  • 22
  • 42
  • 1
    A number of IDEs (such as Eclipse) have a function that can generate the PHPDoc stubs for you – Mark Baker Feb 09 '11 at 09:35
  • +1 Yeah, I'm actually looking for a way to do it programmatically. Basically, run it from the command line and specify a directory (+filters) to iterate through and document. I actually know of Eclipse doing this, but, unfortunately, I use Netbeans and I can't seem to find this functionality. Either way, would be a fun little pet project. :) – Wilhelm Murdoch Feb 09 '11 at 09:45
  • 1
    possible duplicate of [A tool to add and complete PHP source code documentation](http://stackoverflow.com/questions/1936376/a-tool-to-add-and-complete-php-source-code-documentation) – Pekka Feb 09 '11 at 11:37
  • +1 Wow, exactly what I was looking for! Thanks, Pekka! Feel free to add an actual answer and I'll accept it. :) – Wilhelm Murdoch Feb 09 '11 at 12:33

1 Answers1

1

DocumentX might (repeat might) be able to do this.

David Thielen
  • 28,723
  • 34
  • 119
  • 193