Php-GitHook-Sniffer is a simple collection of automated tasks that you can perform with your git repository through the hooks.
- pre-commit
Check the commited files:
- Check PHP Syntax (with PHPLint)
- Fix code style according to PSR2 standard
Coming Soon.
Add joaorobertopb/php-githook-sniffer
as a development dependency in composer.json
"require-dev": {
"joaorobertopb/php-githook-sniffer": "~0.0.5"
}
Or via Composer
$ composer require joaorobertopb/php-githook-sniffer --dev
Copy src/Hooks/pre-commit for .git/hooks. ( Execution Permission Required )
$ php -r "if(file_exists('./.git')&&file_exists('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit')){copy('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit','./.git/hooks/pre-commit');chmod('./.git/hooks/pre-commit',0777);}"
or
"scripts": {
"post-install-cmd": [
"php -r \"if(file_exists('./.git')&&file_exists('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit')){copy('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit','./.git/hooks/pre-commit');chmod('./.git/hooks/pre-commit',0777);}\""
],
"post-update-cmd": [
"php -r \"if(file_exists('./.git')&&file_exists('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit')){copy('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit','./.git/hooks/pre-commit');chmod('./.git/hooks/pre-commit',0777);}\""
]
}
Please see CHANGELOG for more information on what has changed recently.
Coming Soon.
The MIT License (MIT). Please see License File for more information.