PHP code example of unh3ck3d / php-cs-fixer-git-hook

1. Go to this page and download the library: Download unh3ck3d/php-cs-fixer-git-hook 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/ */

    

unh3ck3d / php-cs-fixer-git-hook example snippets


{
  "pre-commit": {
    "enabled": true,
    "actions": [
      {
        "action": "\\Unh3ck3d\\PhpCsFixerGitHook\\LintStagedFiles",
        "options": {
            "phpCsFixerPath": "php-cs-fixer.phar",
            "pathMode": "overwrite",
            "config": ".php-cs-fixer.php",
            "additionalArgs": "-v --dry-run --diff"
        }
      }
    ]
  }
}