{"id":17010774,"url":"https://github.com/gerardroche/php-cs-fixer-pre-commit-hook","last_synced_at":"2025-10-16T16:27:44.042Z","repository":{"id":151329362,"uuid":"343820506","full_name":"gerardroche/php-cs-fixer-pre-commit-hook","owner":"gerardroche","description":"PHP-CS-Fixer pre-commit hook","archived":false,"fork":false,"pushed_at":"2024-08-28T13:46:34.000Z","size":63,"stargazers_count":12,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-21T06:58:41.605Z","etag":null,"topics":["coding-standards","git","hooks","php","php-cs-fixer"],"latest_commit_sha":null,"homepage":"https://www.gerardroche.com","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gerardroche.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-03-02T15:27:55.000Z","updated_at":"2024-08-28T13:46:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"8e2d1a13-b654-41f6-b99b-3e96d6937c16","html_url":"https://github.com/gerardroche/php-cs-fixer-pre-commit-hook","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardroche%2Fphp-cs-fixer-pre-commit-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardroche%2Fphp-cs-fixer-pre-commit-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardroche%2Fphp-cs-fixer-pre-commit-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardroche%2Fphp-cs-fixer-pre-commit-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gerardroche","download_url":"https://codeload.github.com/gerardroche/php-cs-fixer-pre-commit-hook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221831815,"owners_count":16888105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coding-standards","git","hooks","php","php-cs-fixer"],"created_at":"2024-10-14T06:05:25.861Z","updated_at":"2025-10-16T16:27:39.007Z","avatar_url":"https://github.com/gerardroche.png","language":"Shell","readme":"# PHP-CS-Fixer Pre-Commit Hook\n\nRun [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) before committing code in a Git pre-commit hook.\n\nThe fixer runs quietly without making changes to your files, but will stop and print analysis upon first file that needs to be fixed. Only changed files since the last commit are checked, unless configuration files have changed, in which case the fixer runs a full check.\n\nThe hook is invoked by `git commit`, and can be bypassed [using the `--no-verify`](https://git-scm.com/docs/githooks#_pre_commit) option:\n\n```sh\ngit commit --no-verify\n```\n\n## Environment variables\n\n- `PHP_CS_FIXER_IGNORE_ENV=1`\n- `XDEBUG_MODE=off`\n\n## Installation\n\nRun the installer.\n\n```sh\n./install\n```\n\nYou'll thank me later ;)\n\n### Manual installation\n\nCreate the hooks directory and set the [Git hooks path](https://git-scm.com/docs/git-config#Documentation/git-config.txt-corehooksPath).\n\n```sh\nmkdir ~/.githooks \u0026\u0026 git config --global core.hooksPath ~/.githooks\n```\n\nDownload, copy, or symlink the `pre-commit` script to `~/.githooks/pre-commit-php` and ensure the file is executable. The installer symlinks the script into the githooks folder.\n\n```sh\nchmod 744 ~/.githooks/pre-commit-php\n```\n\nCreate a pre-commit script that calls the php-cs-fixer pre-commit and any local pre-commit script if it exits.\n\n```sh\n#!/bin/sh\n\nif [ -f ~/.githooks/pre-commit-php ]; then\n    exec ~/.githooks/pre-commit-php\nfi\n\nif [ -f .git/hooks/pre-commit ]; then\n    exec .git/hooks/pre-commit\nfi\n```\n\n## License\n\nReleased under the [GPL-3.0-or-later License](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerardroche%2Fphp-cs-fixer-pre-commit-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgerardroche%2Fphp-cs-fixer-pre-commit-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerardroche%2Fphp-cs-fixer-pre-commit-hook/lists"}