Skip to content

fmntf/phpadd

Repository files navigation

phpadd

phpadd is Abandoned Docblock Detector for PHP.

It can scan your applications for missing or invalid docblocks. You can also configure it saying to skip docblocks in private and/or protected methods.

Reporting

There are several different reporters: HTML, XML, tab-delimited and JSON. It is possible to ask phpadd to process its output with multiple publishers:

phpadd --publish-html out.html --publish-xml out.xml myapp/

If you just want to see the scan stats, you can append -stats to your publisher:

phpadd --publish-xml-stats stats.xml myapp/

If you specify a dash instead of a filename, the output will be send to stdout.

phpadd --publish-html - myapp/ | grep ...

Filtering

It is possible to prevent PHPADD to look for abandoned DocBlocks in files and classes.

The switch --exclude-paths ignore files matching <path>. The switches --exclude-classes <regexp> and --exclude-methods <regexp> will ignore respectively classes or methods whose names match <regexp>.

Exclude a directory:

phpadd --exclude-paths library/Zend/ --publish-xml stats.xml myapp/

Exclude all directories named controllers in all application subfolders:

phpadd --exclude-paths application/*/controllers/ --publish-xml stats.xml application/

Exclude all constructors:

phpadd --exclude-methods ^__construct$ --publish-xml stats.xml myapp/