Skip to content
Documentation Generator for PHP
PHP HTML JavaScript CSS Gherkin Makefile Other
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.dependabot Add dependabot automerge Dec 20, 2019
.github Make default template the default and more Jan 19, 2020
bin Add convenience binaries for tools Dec 14, 2019
config Render the 'default' template as part of a Guide Jan 21, 2020
cypress/integration Improve handling of constants in new template Jan 14, 2020
data Render the 'default' template as part of a Guide Jan 21, 2020
docs More additions to the new template Jan 15, 2020
src/phpDocumentor Render the 'default' template as part of a Guide Jan 21, 2020
tests Rework Guides Proof of Concept pt 1 Jan 20, 2020
tools Add behat as binary Nov 29, 2019
.dockerignore Make default template the default and more Jan 19, 2020
.env Initial effort to replace Cilex with Symfony4 Apr 27, 2018
.env.dist Initial effort to replace Cilex with Symfony4 Apr 27, 2018
.gitattributes Remove vagrant, improve docker flow and remove old build artefacts Jan 1, 2018
.gitignore Make default template the default and more Jan 19, 2020
.scrutinizer.yml don't analyze phpstan Jan 11, 2018
CHANGELOG.md Introduce flysystem for parser source Dec 10, 2017
CONTRIBUTING.md Update CONTRIBUTING.md with new branches and repo names Nov 23, 2019
Dockerfile Make default template the default and more Jan 19, 2020
LICENSE add license name Jan 9, 2018
Makefile Add missing symbols to require checker and check on pre-commit Jan 21, 2020
README.md Update README with a couple of links Jan 12, 2020
VERSION fixed version Feb 11, 2018
behat.yml add config file test Dec 30, 2019
box.json Explicitly add secrets folder Dec 21, 2019
composer-require-config.json Add League exceptions to require checker whitelist Dec 30, 2019
composer.json Add missing symbols to require checker and check on pre-commit Jan 21, 2020
composer.lock Add missing symbols to require checker and check on pre-commit Jan 21, 2020
cypress.json Add initial e2e test for Default template Jan 2, 2020
docker-compose.yml Simplify Docker setup Jan 6, 2020
package-lock.json Add initial e2e test for Default template Jan 2, 2020
package.json Add initial e2e test for Default template Jan 2, 2020
phive.xml Simplify installation of phive and add ocular Nov 25, 2019
phpcs.xml.dist EXPERIMENTAL: Guide Generation Jan 19, 2020
phpdoc.dist.xml Rework Guides Proof of Concept pt 1 Jan 20, 2020
phpmd.xml.dist Fixing type inference and variable length issues Jul 31, 2014
phpstan.neon EXPERIMENTAL: Guide Generation Jan 19, 2020
phpunit.xml.dist EXPERIMENTAL: Guide Generation Jan 19, 2020
symfony.lock Add missing symbols to require checker and check on pre-commit Jan 21, 2020

README.md

License: MIT Build Status Code Coverage Scrutinizer Code Quality Packagist Version Packagist Pre Release Version Downloads

phpDocumentor

What is phpDocumentor?

phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to generate a complete set of API Documentation.

Inspired by phpDocumentor 1 and JavaDoc it continues to innovate and is up to date with the latest technologies and PHP language features.

phpDocumentor v2 (stable)

The current stable version of phpDocumentor is v2.9, which can be used to generate documentation for PHP applications up to PHP version 7.0. phpDocumentor is an old tool that doesn't support all 7.0 introduced features. It will not process any scalar type hints and requires docblock tags to generate API documentation. If your application/library is using PHP 7.0 or lower consult our v2 branch for installation instructions and detailed information about how to use phpDocumentor.

phpDocumentor v3 (under development)

Note: The phpDocumentor team is currently working on a new phpDocumentor generation. It will have full support for the latest features in PHP, so you can take advantage of all native type hints. v3 is still under development and is not stable enough to use in a daily development flow.

Nightly builds

Phpdocumentor doesn't have a nightly release. However, during each pipeline a [phar] artifact is built. If you want to test the bleeding edge version of phpDocumentor, have a look in the actions section of this repository. Each successful QA workflow has a download at the right upper corner.

Installation

phpDocumentor requires PHP 7.2 or higher to run. However, code of lower PHP versions can be analyzed.

All templates provided with phpDocumentor have support for Class diagrams based on the read code base. This will require the application Graphviz to be installed on the machine running phpDocumentor. Rendering the class diagrams using Graphviz is optional, and warnings about missing Graphviz can be ignored. However, your documentation will contain some dead links in this case.

There are 3 ways to install phpDocumentor:

  1. Using phive (recommended)
  2. Using the PHAR (manual install)
  3. Via Docker
  4. Via Composer

Using Phive

$ phive install --force-accept-unsigned phpDocumentor

For more information about phive have a look at their website. Now you have phpDocumentor installed and it can be executed directly.

php tools/phpDocumentor

Using the PHAR

  1. Download the phar file from https://github.com/phpDocumentor/phpDocumentor/releases
  2. You can execute the phar like this: php phpDocumentor.phar

Via docker

  1. $ docker pull phpdoc/phpdoc
  2. $ docker run --rm -v $(pwd):/data phpdoc/phpdoc

Via Composer (not recommended)

  1. phpDocumentor is available on Packagist.

  2. It can be installed as a dependency of your project by running

     $ composer require --dev phpdocumentor/phpdocumentor dev-master
    

Afterwards you are able to run phpDocumentor directly from your vendor directory:

$ php vendor/bin/phpdoc

Please note that we are not able to be compatible with all types of setups. In some situations, phpDocumentor will block updates of other packages. We do not recommend using composer to install phpDocumentor.

PEAR

Starting from phpDocumentor v3 we decided to drop PEAR support due to declining use. We will provide the already released versions of phpDocumentor v2, but these versions will be community maintained so that the team can focus on phpDocumentor 3.

How to use phpDocumentor?

The easiest way to run phpDocumentor is by running the following command:

$ phpdoc run -d <SOURCE_DIRECTORY> -t <TARGET_DIRECTORY>

This command will parse the source code provided using the -d argument and output it to the folder indicated by the -t argument.

phpDocumentor supports a whole range of options to configure the output of your documentation. You can execute the following command, or check our website, for a more detailed listing of available command-line options.

$ phpdoc run -h

Configuration file(s)

phpDocumentor also supports the use of configuration files (named phpdoc.xml or phpdoc.dist.xml by default). Please consult the documentation to see the format and supported options.

Documentation

For more detailed information you can check our online documentation at https://docs.phpdoc.org.

Features

phpDocumentor supports the following:

  • PHP 7.0 compatible, full support for Namespaces, Closures and more is provided.
  • Shows any tag, some tags add additional functionality to phpDocumentor (such as @link).
  • Processing speed, Zend Framework experienced a significant reduction in processing time compared to phpDocumentor 1.
  • Low memory usage, peak memory usage for small projects is less than 20MB, medium projects 40MB and large frameworks 100MB.
  • Incremental parsing, if you kept the Structure file from a previous run you get an additional performance boost of up to 80% on top of the mentioned processing speed above.
  • Easy template building, if you want to make a branding you only have to call 1 task and edit 3 files.
  • Command-line compatibility with phpDocumentor 1, phpDocumentor 2 is an application in its own right but the basic phpDocumentor 1 arguments, such as --directory, --file and --target, have been adopted.
  • Two-step process, phpDocumentor first generates a cache with your application structure before creating the output. If you'd like you can use that to power your own tools or formatters!

Please note that phpDocumentor 3 is still under development. We will add all features needed to have full support for PHP 7.0 and higher.

Contact

To come in contact is dead simple and can be done in a variety of ways.

You can’t perform that action at this time.