In PHP, an established tool is adding GrumPHP [0] to your dependencies.
It will then handle git hooks on each commit via composer script by default (but can be omitted per commit).
[0] https://github.com/phpro/grumphp