PHPADD Manual

Installing PHPADD
PHPADD can be installed via PEAR:

pear channel-discover pear.webmatters.it
pear install webmatters/phpadd

Running PHPADD
The simplest way to run PHPADD is as follow:

phpadd --publish-html /tmp/output.html /directory/to/analyze

It will create a file like this.

Configuration switches
It’s possible to alter the standar behaviour of PHPADD via some switches. For example, if you start it with --skip-protected it will ignore protected methods at all, so it will not report missing/outdated docblocks on methods with that scope. The switch --skip-private works in the same way, but for private methods.

Publishers
Available publishers are: html, xml, json, delim (tab-delimited plain text). Use them with –publish-publishername (like --publish-json).
You can configure a publisher to force it to provide only the stats, by appending -stats (like --publish-json-stats).

Bootstrap
It is possible to include a file before scanning /directory/to/analyze with the switch --bootstrap /path/to/bootstrap.php. This bootstrap file can contain, for example, a call to spl_autoload_register() or whatever you need to scan your file. Please note each processed file is included by PHPADD, so if your classes are extending something not in the include path you will need an autoloader.
Of course, this bootstrap can even be a list of require_once() calls if you have a few needed classes.

Hudson integration
PHPADD output can be easily integrated into Hudson builds. You just need HTML Reporter plugin. Configuration is trivial, you just have to tell Hudson where PHPADD writes it’s output.

Comments are closed.