Here a short follow up for the PHP_Depend release announcement, with hints on using PHP_Depend.
First I must explain that PHP_Depend is working package oriented. This means it heavily relies on @package and @subpackage annotations within the comment blocks. For these annotations PHP_Depend applies the following rules, these rules are borrowed from PEAR. Or was it PHPDocumentor?
- function: The
@package/@subpackage annotation in the file level comment is used for all functions declared within this file.
- class/interface: The
@package/@subpackage annotation within the class or interface comment is used for that type.
- everything else: Everything that doesn't match on one of the previous rules is part of the +global Package.
With default settings PHP_Depend suppresses the +global Package, because it expects that this package contains classes from external libraries, like Zend Framework or eZComponents. If you use PHP_Depend for a project with less or no @package/@subpackage annotation, you should use the cli option --bad-documentation, which forces PHP_Depend to keep all classes, interfaces and functions within the +global package. This option was introduced with PHP_Depend - 0.8.0beta3.
The second important hint is related to exported charts and images. If your operation system, image viewer or browser supports SVG, you should use this format. The reason for this decision is really simple, SVG provides tooltips and so you get most informations from the generated graphics.
For the Overview-Pyramid this means, that you get a tooltip for the used acronyms.
And within the JDepend-chart you get the package name as tooltip.
I hope this short introduction helps you while you are trying out PHP_Depend. If you are already using the metrics feature of PHPUnit, you should try out the new --phpunit-xml log option in the latest SVN-Revision.