PHP code example of xheaven / composer-git-hooks
1. Go to this page and download the library: Download xheaven/composer-git-hooks library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xheaven / composer-git-hooks example snippets
json
{
"extra": {
"hooks": {
"pre-commit": [
"echo committing as $(git config user.name)",
"php-cs-fixer fix ."
],
"commit-msg": "grep -q '[A-Z]+-[0-9]+.*' $1",
"pre-push": [
"php-cs-fixer fix --dry-run .",
"phpunit"
],
"post-merge": "composer install",
"...": "..."
}
}
}