Generate php documentation from source code
UsageEasy to install, and to use!Getting started using the PHARStart by downloading our latest PHAR file and giving it a nice and cozy place on your hard drive. Show
After you downloaded the PHAR file, don't forget to power it up by making it executable.
Also, you may want to consider renaming it to
Then, all you need to do is run it! Getting started using DockerUse our very own Docker image; no installation needed! Treat our docker image like you treat all your other utility images. Just don't forgot to volume mount your current directory to
Tada! phpDox is the documentation generator for PHP projects. By default, phpDox uses PHP-Parser to collect information about a PHP codebase. The information collected is stored in XML documents. This information is rendered to HTML, for instance, by applying XSL transformations to the XML data. CollectThanks to PHP-Parser, phpDox will always be able to parse PHP code that uses the latest syntax features of the language. An API is provided to register custom or extended backends as well as additional DocBlock annotation parsers. EnrichThe enricher subsystem of phpDox is based on plugins. Writing enricher plugins is easy and allows phpDox to process additional information from new tools quickly. GenerateThe generator subsystem is based on plugins, so-called engines. The default HTML engine uses XSLT stylesheets that ship with phpDox and can be adapted or replaced to customize the presentation of the information that is processed. It's fast, too.It takes 1.26 minutes (and 50 MB of memory) to process Zend Framework 2 on the first run. For ActionScript 2, I've used NaturalDocs. However it has pretty poor support for PHP. I've looked so far at doxygen and phpDocumentor, but their output is pretty ugly in my opinion. Does anyone have any experience with automatic documentation generation for PHP? I'd prefer to be able to use javadoc-style tags, they are short to write and easy to remember.
albert 7,5983 gold badges18 silver badges31 bronze badges asked Oct 9, 2008 at 22:55
0 ApiGenhttp://apigen.org/ ApiGen has support for PHP 5.3 namespaces, packages, linking between documentation, cross referencing to PHP standard classes and general documentation, creation of highlighted source code and experimental support for PHP 5.4 traits. DocBloxhttp://www.docblox-project.org/ PHP 5.3 compatible API Documentation generator aimed at projects of all sizes and Continuous Integration. able to fully parse and transform Zend Framework 2 answered Dec 31, 2011 at 19:35
3 There are two well-known and often-used tool that can generate API doc from docblocks :
A great thing being that recent IDE (like Eclipse PDT, for instance), can read and interpret those markers, to provide hints when you're coding ;-)
For instance, PHPUnit allows you to specify some test-related stuff using some specific tags -- see Annotations.
albert 7,5983 gold badges18 silver badges31 bronze badges answered Dec 18, 2009 at 5:38
Pascal MARTINPascal MARTIN 388k77 gold badges646 silver badges656 bronze badges 1 PHPDoc is probably as good as you'll get it in terms of Javadoc style inline commenting. You might also want to look at PHPXRef. answered Dec 18, 2009 at 5:39
3 Yes, phpDocumentor (http://www.phpdoc.org/) is an acceptable standard tool for PHP autodocs. It's the de-facto standard. It's acceptable to follow the general JavaDoc guidelines for code when documenting PHP code. However, you're going to run into cases where that's not enough because PHP and Java are different languages. For example, PHP functions have no return type and it's inevitable (and sometimes desirable) for a function to return one type with one context, and another type with in a second context. JavaDoc guidelines aren't going to help with that, because it's impossible to do in Java. answered Dec 18, 2009 at 5:56
Alan StormAlan Storm 162k89 gold badges386 silver badges585 bronze badges 2 phpDocumentor can output in a style similar to the php.net documentation (and its built in with both smarty and non smarty layouts) answered Oct 9, 2008 at 23:11
Ólafur WaageÓlafur Waage 67.3k19 gold badges140 silver badges194 bronze badges 1 The Wordpress code-base is documented using phpdoc tags (see this) and it's generally pretty good - it's rendered here using phpDocumentor. Most of the code that I write that's substantial enough that I need to think about autogenerating docs for is done in .Net, so I can't give much of a documentation writer's perspective though answered Dec 18, 2009 at 5:41
coricori 8,4667 gold badges44 silver badges80 bronze badges If ugly's a problem, I'd just switch the stylesheet for a custom one. If you don't want to overwrite the generated one, you can use a Firefox plugin like Stylish. answered Oct 9, 2008 at 23:01
AupajoAupajo 5,7476 gold badges29 silver badges28 bronze badges You could edit the template file to add your own stylesheet to override the existing one. answered Oct 9, 2008 at 23:23
Darryl HeinDarryl Hein 140k89 gold badges213 silver badges259 bronze badges Not the answer you're looking for? Browse other questions tagged php documentation documentation-generation or ask your own question.How do I document PHP code?Properly document PHP code. Classes. Start every class with /** * Class description * * @author Your organization or personal name * @license MIT (or other licence) */. Properties. Document every property with /** * Property brief description * * @var type */. Methods. ... . What is Inheritdoc PHP?Description. The {@inheritdoc} inline tag is used in the class DocBlocks of child classes. phpDocumentor will automatically inherit the @author tag, @version tag, and @copyright tag from a parent class. {@inheritdoc} allows flexibility of where to put documentation from the parent class in a child class's documentation ...
What is PHPDoc in PhpStorm?Using PHPDoc code inspections
PhpStorm provides a set of predefined code inspections targeted at PHPDoc blocks. These inspections check whether classes, methods, functions, variables, and constants are supplied with a PHPDoc comment and whether the tags in the comment match the documented item.
|