ccinn / husky-php
Similar to js-husky client git hook implementation
Installs: 26 005
Dependents: 1
Suggesters: 0
Security: 0
Stars: 66
Watchers: 2
Forks: 10
Open Issues: 3
pkg:composer/ccinn/husky-php
Requires
- php: >=8.0
- ext-json: *
- symfony/console: ^5.4|^6
- symfony/filesystem: ^5.4|^6
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.13
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-10-09 09:35:49 UTC
README
PHP is combined with composer to implement functionality similar to js's NPM module husky
Git hooks made easy
Husky can prevent bad git commit, git push and more git's hooks
Code Contributors
This project exists thanks to all the people who contribute. [Contribute].
Branch
- v5.6-7.3.x => "ccinn/husky-php": "^0.1.0"
- v7.4 => "ccinn/husky-php": "^0.2.0"
- v8.0.0 => "ccinn/husky-php": "^0.4.0"
Install
In composer.json
"require-dev": {
"ccinn/composer-husky-plugin": "^0.1.0",
"ccinn/husky-php": "^0.4.0"
},
Or
In Shell
composer require --dev ccinn/composer-husky-plugin ccinn/husky-php
Docker
docker build --build-arg PHP_VERION=8.0.9 -t husky-php .
Usage
you can also configure hooks using .huskyrc or .huskyrc.json file.
// .huskyrc or .huskyrc.json { "hooks": { "pre-commit": "echo 'husky-php-pre-commit'", "pre-push": "echo 'husky-php-pre-push'", "...": "..." } }
Running the git action hooks will be triggered
git commit -m 'Keep calm and commit'
You will see
husky-php-pre-commit
Default
By default, the pre - commit
Default support features:
-
Detect code conflicts
-
Test code specifications
-
Check code syntax
Window User
You need run in bash environment, for example:GitBash