{"id":15042450,"url":"https://github.com/nafigator/php-qa-hooks","last_synced_at":"2025-04-14T20:33:32.053Z","repository":{"id":10530615,"uuid":"12723378","full_name":"nafigator/php-qa-hooks","owner":"nafigator","description":"Bunch of useful git hooks","archived":false,"fork":false,"pushed_at":"2021-07-31T12:51:31.000Z","size":357,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T08:51:13.900Z","etag":null,"topics":["bash-script","code-standard","code-style","git","git-conflicts","git-hooks","php","php-syntax"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nafigator.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}},"created_at":"2013-09-10T07:43:20.000Z","updated_at":"2024-10-21T15:56:02.000Z","dependencies_parsed_at":"2022-08-30T19:11:30.351Z","dependency_job_id":null,"html_url":"https://github.com/nafigator/php-qa-hooks","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nafigator%2Fphp-qa-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nafigator%2Fphp-qa-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nafigator%2Fphp-qa-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nafigator%2Fphp-qa-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nafigator","download_url":"https://codeload.github.com/nafigator/php-qa-hooks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248956304,"owners_count":21189323,"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":["bash-script","code-standard","code-style","git","git-conflicts","git-hooks","php","php-syntax"],"created_at":"2024-09-24T20:47:20.001Z","updated_at":"2025-04-14T20:33:32.029Z","avatar_url":"https://github.com/nafigator.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub license][License img]][License src] [![GitHub release][Release img]][Release src] [![Conventional Commits][Conventional commits badge]][Conventional commits src] [![Semantic Versioning][Versioning img]][Versioning src]\n\n# PHP QA git hooks\nGit hooks for PHP commits quality assurance\n\n![pre-commit output example][pre-commit img]\n\n### Requirements\n* git\n* bash\n* PHP CLI\n* Core utils\n\n### Features\n* Customization by git config options\n* Check for PHP syntax before commit\n* Check for Git conflict markups before commit\n* Warn about PHP dump functions (var_dump(), var_export(), print_r())\n* Check PHP code style before push\n* Run PHPUnit tests before push\n* Colored output\n\n### Install via Composer\n1. Install package:\n\n        composer require --dev nafigator/php-qa-hooks\n2. Add *extra* section to *composer.json*:\n\n        \"extra\": {\n            \"scripts-dev\": {\n                \"post-install-cmd\": \"vendor/nafigator/php-qa-hooks/src/hooks-install.sh\"\n            }\n        }\n3. Place *phpcs.xml* into root of your project.\n    \u003e NOTE: An example phpcs.xml file can be found in the PHP_CodeSniffer repository: [phpcs.xml.dist]\n\n4. Run `composer install`.\n### Uninstall\n1. Remove git config section `check.php`\n\n        git config --remove-section check.php\n2. Add *extra* section to *composer.json*:\n\n        \"extra\": {\n            \"scripts-dev\": {\n                \"post-install-cmd\": \"vendor/nafigator/php-qa-hooks/src/hooks-uninstall.sh\"\n            }\n        }\n    Commit and push your changes to repository. When uninstall script completes\n    cleanup for all work copies, move to next step.\n3. Remove package:\n\n        composer remove --dev nafigator/php-qa-hooks\n4. Remove *phpcs.xml* from root ot your project.\n\n### Configuration\nExample (colors off):\n\n    git config check.php.colors false\n\nAvailable git config options:\n\n    check.php.colors [true|false]\n    check.php.conflicts [true|false]\n    check.php.dumps [true|false]\n    check.php.phpunit [true|false]\n    check.php.style [true|false]\n    check.php.syntax [true|false]\n\n\u003eNOTE: PHPUnit disabled by default. You need to enable it manually.\n\n### Versioning\nThis software follows *\"Semantic Versioning\"* specifications. All function signatures declared as public API.\n\nRead more on [SemVer.org](http://semver.org).\n\n  [Conventional commits src]: https://conventionalcommits.org\n  [Conventional commits badge]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg\n  [Release img]: https://img.shields.io/badge/release-1.0.6-brightgreen.svg\n  [Release src]: https://github.com/nafigator/php-qa-hooks\n  [pre-commit img]: https://github.com/nafigator/git-hooks/raw/master/.images/pre-commit.jpg\n  [License img]: https://img.shields.io/badge/license-MIT-brightgreen.svg\n  [License src]: https://tldrlegal.com/license/mit-license\n  [Versioning img]: https://img.shields.io/badge/Semantic%20Versioning-2.0.0-brightgreen.svg\n  [Versioning src]: https://semver.org\n  [phpcs.xml.dist]: https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/3.4.2/phpcs.xml.dist\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnafigator%2Fphp-qa-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnafigator%2Fphp-qa-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnafigator%2Fphp-qa-hooks/lists"}