Don't forget to set PHP Code Style to PSR-2 in your PHPStorm
PhpStorm reformat code-PhpStorm now bundles WordPress coding style natively, starting from version 8. Go to Project Settings Code Style PHP. To get to this final step, open PhpStorm back up and head over to PhpStorm Preferences Editor Inspections and drill down to PHP PHP Code Sniffer validation. Check that box, and if everything was properly set up, you should be able to select a coding standard from the dropdown (hit the refresh button if you don’t see any). S t a l k e r for mac.
1) Add Code Sniffer to composer.json file
2) Create the phpcs.xml
(for Laravel) file in your root project folder
3) Enable Code Sniffer and select coding standard in your PHPStorm
More info here: How to setup PHP Code Sniffer in PHPStorm
4) Add the git hook pre-commit-hook.sh
:
- In the scripts section of
composer.json
Now when you run composer install
your pre-commit hook will be activated.More infor about the steps 4 and 5, here: Setting up PHPCS and PreCommit Githooks to a Laravel Project
Squizlabs/php_codesniffer Phpstorm
Php_codesniffer Phpstorm
Extra)
Php Code Sniffer Phpstorm Docker
You can also use the Pre Commit Hook Pluginto use your pre-commit-hook.sh
Wireless dongle for mac.