Githooks are scripts that Git executes before or after events such as commit, push, and receive. Git hooks are a built-in feature — no need to download anything.
We mentioned that we configure grumphp to PSR12 standards and that was under the line of phpcs, let’s understand what phpcs and what are other PHP scripts that we can use to detect violations in the code.
You can install PHP_CodeSniffer in your project using composer via the command: You will have two scripts added to your project
To add it to your project you can use composer via command: You also need to configure it under the grumphp.yml configuration file: Remember to change the directory to the directory that you wish to sniff.