{"id":18903597,"url":"https://github.com/intaro/php-git-hooks","last_synced_at":"2025-04-15T03:33:35.035Z","repository":{"id":18572703,"uuid":"21775500","full_name":"intaro/php-git-hooks","owner":"intaro","description":"Git hooks for the local repository of the PHP project","archived":false,"fork":false,"pushed_at":"2018-12-19T14:46:40.000Z","size":8,"stargazers_count":20,"open_issues_count":1,"forks_count":12,"subscribers_count":11,"default_branch":"master","last_synced_at":"2023-08-12T17:32:24.037Z","etag":null,"topics":["git-hooks","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intaro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-12T20:05:19.000Z","updated_at":"2020-05-08T12:33:41.000Z","dependencies_parsed_at":"2022-07-26T23:02:08.399Z","dependency_job_id":null,"html_url":"https://github.com/intaro/php-git-hooks","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intaro%2Fphp-git-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intaro%2Fphp-git-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intaro%2Fphp-git-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intaro%2Fphp-git-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intaro","download_url":"https://codeload.github.com/intaro/php-git-hooks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223657849,"owners_count":17181024,"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":["git-hooks","php"],"created_at":"2024-11-08T09:05:52.240Z","updated_at":"2024-11-08T09:05:53.168Z","avatar_url":"https://github.com/intaro.png","language":"PHP","readme":"# PHP Git Hooks\n\nThe Git hooks for applying in the local repository of the PHP project. Include the `pre-commit` hook.\n\n## Installation\n\nClone repository:\n\n```bash\ncd some/path\ngit clone https://github.com/intaro/php-git-hooks\ncd php-git-hooks\nphp -r \"readfile('https://getcomposer.org/installer');\" | php\n./composer.phar install\n```\n\nMake symlink to the `pre-commit` file:\n\n```bash\ncd some/symfony/project/.git/hooks\nln -s some/path/php-git-hooks/pre-commit pre-commit\n```\n\n## pre-commit\n\nChecks the committed files:\n\n* PHP Syntax on PHP-errors (with PHPLint)\n* Check code style for compliance with the standard PSR2\n\nBased on `pre-commit` hook of [Carlos Buenosvinos](http://carlosbuenosvinos.com/write-your-git-hooks-in-php-and-keep-them-under-git-control/).\n\n### Example of output\n\n```bash\n$ git ci -m \"commit message\"\nIntaro Code Quality Tool\nFetching files\nRunning PHPLint\nChecking code style\n1) src/Acme/DemoBundle/Tests/Controller/DefaultControllerTest.php (unused_use, eof_ending)\n\n  [Exception]\n  There are coding standards violations!\n```\n\n```bash\n$ git ci -m \"commit message\"\nIntaro Code Quality Tool\nFetching files\nRunning PHPLint\nChecking code style\nChecking code style with PHPCS\nFILE: ...m/src/Acme/DemoBundle/Tests/Controller/DefaultControllerTest.php\n--------------------------------------------------------------------------------\nFOUND 0 ERROR(S) AND 2 WARNING(S) AFFECTING 2 LINE(S)\n--------------------------------------------------------------------------------\n 197 | WARNING | Line exceeds 120 characters; contains 172 characters\n 212 | WARNING | Line exceeds 120 characters; contains 128 characters\n--------------------------------------------------------------------------------\n\n  [Exception]\n  There are PHPCS coding standards violations!\n```\n\n```bash\n$ git ci -m \"commit message\"\nIntaro Code Quality Tool\nFetching files\nRunning PHPLint\nChecking code style\nChecking code style with PHPCS\nGood job dude!\n[some-branch 0f5ea39] commit message\n 10 files changed, 357 insertions(+), 17 deletions(-)\n create mode 120000 bin/php-cs-fixer\n create mode 120000 bin/phpcs\n create mode 100644 src/Acme/DemoBundle/Tests/Controller/DefaultControllerTest.php\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintaro%2Fphp-git-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintaro%2Fphp-git-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintaro%2Fphp-git-hooks/lists"}