We often need to check the code when PHP is encoded, which comes with
php -l
The feature is too weak to be checked for syntax errors only.
What I need is a checking tool that can be used in a production environment, such as detecting useless variables, or directly using uninitialized variables, and, of course, analyzing potential error codes, and it's best to detect some code style issues. This allows you to control some of the quality issues while developing on a larger scale.
For example, Lint this toolset, in addition to the original C language version, there are other versions of the implementation of CSS Lint, JS Lint and so on, do not know PHP has similar tools.
Reply content:
We often need to check the code when PHP is encoded, which php -l
is too weak to be checked for syntax errors.
What I need is a checking tool that can be used in a production environment, such as detecting useless variables, or directly using uninitialized variables, and, of course, analyzing potential error codes, and it's best to detect some code style issues. This allows you to control some of the quality issues while developing on a larger scale.
For example, Lint this toolset, in addition to the original C language version, there are other versions of the implementation of CSS Lint, JS Lint and so on, do not know PHP has similar tools.
Of course.
PHP Mess Detector (http://phpmd.org/)
PHP Project Physical Examination tool, according to the criteria you set (such as the single File code volume, the number of unused parameters, the number of unused methods) to check the PHP code, beyond the set standard when the alarm.
PHP Copy Paste Detector (https://github.com/sebastianbergmann/...)
As the name implies, check for redundant code
PHP Dead Code Detector (https://github.com/sebastianbergmann/...)
Look at the name, check out the methods that have never been called.
PHP Code Sniffer (Http://pear.php.net/package/PHP_CodeS ...)
Old code formatting tools, PHP written, pear package, can be self-hack, can be integrated into the command line. I have been using the PHP Code beautifier, only Windows gui,windows cmd is very difficult to use, has been planning to switch to PHP CS
You can also use Jenkins to integrate the above-mentioned tools in plugins form for continuous integration: http://jenkins-php.org/
You can also use xinc+phing to integrate with the above-mentioned tools to automate the package release after continuous integration: http://code.google.com/p/xinc/
Phplint http://www.icosaedro.it/phplint/
Is that what you want?