We often need to check the code when coding in php. Its built-in php-l function is too weak and can only be checked for syntax errors. What I need is a checking tool that can be used in the production environment, such as detecting useless variables or directly using uninitialized variables... we often need to check the code when coding in php. It comes
php -l
The function is too weak. You can only check for syntax errors.
What I need is a checking tool that can be used in the production environment, such as detecting useless variables or directly using uninitialized variables, of course, you need to analyze potential error codes. It is best to detect some code style problems. In this way, some quality problems can be controlled during large-scale development.
For example, Lint is a tool set. In addition to the original C language version, it also has other versions to Implement CSS Lint and JS Lint. I Don't Know If php has similar tools.
Reply content:
We often need to check the code when coding in php. It comesphp -l
The function is too weak. You can only check for syntax errors.
What I need is a checking tool that can be used in the production environment, such as detecting useless variables or directly using uninitialized variables, of course, you need to analyze potential error codes. It is best to detect some code style problems. In this way, some quality problems can be controlled during large-scale development.
For example, Lint is a tool set. In addition to the original C language version, it also has other versions to Implement CSS Lint and JS Lint. I Don't Know If php has similar tools.
Of course.
PHP Mess Detector (http://phpmd.org /)
The PHP project Health Check Tool checks PHP code based on your set standards (such as the size of a single file code, the number of unused parameters, and the number of unused methods) and generates an alarm when the preset standard is exceeded.
PHP Copy Paste Detector (https://github.com/sebastianbergmann ...)
Check for redundant code
PHP Dead Code Detector (https://github.com/sebastianbergmann ...)
Check the method that has never been called.
PHP Code Sniffer (http://pear.php.net/package/PHP_CodeS ...)
The old code formatting tool, written in PHP, And the Pear package, can be hack by itself and can be integrated into the command line. I have been using PHP Code Beautifier, only Windows GUI, Windows CMD is very difficult to use, and I plan to switch to PHP CS
You can also use jenkins to integrate the above tools in the form of plugins for continuous integration: http://jenkins-php.org/
You can also use xinc + phing to integrate with the above tools for continuous integration of automated packaging release: http://code.google.com/p/xinc/
PHPLint http://www.icosaedro.it/phplint/
Is it what you want?