This repository is a simple Gulp example for PHP integrating PHPUnit, PHPlint, PHP_CodeSniffer, PHP Mess Detector, PHP Copy/Paste Detector, PHP Codebeautifier, PHP_Depend and PHPDoc.
At first, clone this repository to the location of your choice. Then install the required dependencies by:
composer install
sudo npm install
The php folder includes some sample PHP files. You can find according example unit test cases in the folder "tests".
Having all setup you can use the following commands (according to gulpfile.js):
Starts phplint
gulp phplint
Starts the code sniffer using PSR-2 coding standard
gulp phpcse
Starts the code beautifier using PSR-2 coding standard
gulp phpcbf
Starts the mess detector
gulp phpmd
Starts the metrics generator
gulp pdepend
Starts the copy/paste detector
gulp phpcpd
Starts the unit tests
gulp phpunit
Generates an API documentation of the PHP files
gulp phpdoc
Watches the folder "php" for changes in php files and runs 'phplint', 'phpcs', 'phpunit', 'phpmd' and 'phpcpd'
gulp watch