Features
Sonar PHP Plugin provides PHP language support to Sonar. The plugin enables all Sonar builtin features for PHP projects.
It relies on well known external analysis tools for PHP: PHP Unit, PHP Depend, PHPMD and PHP_CodeSniffer.
Sonar PHP Plugin | PHPUnit | phpcpd | PHP Depend | PHPMD | PHP_CodeSniffer |
|---|---|---|---|---|---|
0.3 | 3.5.5 | 1.3.1 | 0.9.14 | 0.2.5 | 1.3.0RC1 |
0.4 | 3.5.5 | 1.3.1 | 0.9.14 | 0.2.5 | 1.3.0RC1 |
0.5 | 3.5.5 | 1.3.1 | 0.10.6 | 1.1.0 | 1.3.0RC1 |
0.6 | 3.5.5 | 1.3.5 | 0.10.6 | 1.1.0 | 1.3.1 |
| 1.0 (not released yet!) | 3.5.5 | - | 0.10.7 | 1.1.0 | 1.3.2 |
| Which versions of the external tools should you use? The versions listed above are those we use for developments and tests, and we recommend you to also install those ones (even if the PHP Plugin might be compatible with older versions as well). |
Where to start?
Here are the main steps to get started:
- Install Sonar, the PHP plugin and everything that is needed to run analyses
- Then, choose how you want to run an analysis on your PHP project
Once you're familiar with the plugin, you can dig more into the documentation to discover advanced features (like adding your own PHP CodeSniffer or PHPMD rules into Sonar).
Known limitations
See open issues
Roadmap
- PHP 1.0 - very-short-term activity. (see the JIRA open tickets - ETA: January 20th, 2012)
- Big work on the PHP CodeSniffer rule repository (adding missing parameters, descriptions, ...)
- Work on the "Sonar Way", PEAR and Zend profiles (<= for PHP gurus!
) - Replacement of PHPCPD by an internal implementation
- Improve execution of external tools (display more info in the log, fail the Sonar build when necessary, fix bugs with process arguments, ...)
- Various improvements on PHPUnit, PHPDepend
- PHP 1.1 - mid-term activity
- Handle multiple files with the same name
- Consider root folders as "Projects"
- Non structured PHP files
- If it turns out that those tickets are technically difficult/long to implement, then they can be postponed
Changelog

