{"id":19783111,"url":"https://github.com/edmondscommerce/phpqa","last_synced_at":"2025-10-07T21:11:05.725Z","repository":{"id":56975108,"uuid":"119806729","full_name":"edmondscommerce/phpqa","owner":"edmondscommerce","description":"A PHP Quality Assurance pipeline designed to be run locally and in CI. Written in Bash.","archived":false,"fork":false,"pushed_at":"2021-03-23T11:25:22.000Z","size":686,"stargazers_count":6,"open_issues_count":14,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T05:34:26.161Z","etag":null,"topics":["bash","coverage-report","php","php-qa","phpunit","pipeline","qa-process","sniffer","travis"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/edmondscommerce.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":"2018-02-01T08:32:56.000Z","updated_at":"2021-02-09T16:40:14.000Z","dependencies_parsed_at":"2022-08-21T11:50:18.279Z","dependency_job_id":null,"html_url":"https://github.com/edmondscommerce/phpqa","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edmondscommerce%2Fphpqa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edmondscommerce%2Fphpqa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edmondscommerce%2Fphpqa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edmondscommerce%2Fphpqa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edmondscommerce","download_url":"https://codeload.github.com/edmondscommerce/phpqa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251791578,"owners_count":21644421,"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","coverage-report","php","php-qa","phpunit","pipeline","qa-process","sniffer","travis"],"created_at":"2024-11-12T06:07:20.079Z","updated_at":"2025-10-07T21:11:00.707Z","avatar_url":"https://github.com/edmondscommerce.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHPQA\n## By [Edmonds Commerce](https://www.edmondscommerce.co.uk)\n\n\n## Version 4 Updates\n\nBrings in PHPStan 0.12 which is great\n\nHowever you will need to do the following:\n\n\n# Remove PHPStan symlinks before upgrading\n```bash\nrm -f bin/phpstan*\n```\n\n# Ensuring Correct PHPStan Configs\n\nIf you are overriding `phpstan.neon` in your `qaConfig` folder, then you need to make sure you have this in there:\n\n```neon\nparameters:\n    level: max\n    inferPrivatePropertyTypeFromConstructor: true\n```\n\n\n\n## Version 3 Updates\n\nYou should update your phpunit.xml file to use `        printerClass=\"\\PHPUnit\\Util\\TestDox\\CliTestDoxPrinter\"`\n\n[see ./phpunit.xml](./phpunit.xml)\n\n\n## Introduction\n\nPHPQA is a quality assurance pipeline written in BASH that can be run both on the desktop as part of your development process and then also as part of a continuous integration (CI) pipeline.\n\nIt runs tools in a logical order and will fail as quickly as possible.\n\nPHPQA has only been tested on Linux.\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/884a284be5cd4dd3a49c199119385f58)](https://www.codacy.com/app/edmondscommerce/phpqa?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=edmondscommerce/phpqa\u0026amp;utm_campaign=Badge_Grade) \n[![Build Status](https://travis-ci.org/edmondscommerce/phpqa.svg?branch=master)](https://travis-ci.org/edmondscommerce/phpqa)\n[![Code Coverage](https://scrutinizer-ci.com/g/edmondscommerce/phpqa/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/edmondscommerce/phpqa/?branch=master)\n\n## Installing\n\nYou can follow dev-master which should generally be pretty stable (all features are developed in feature branches and must pass CI before making it into master. Alternatively if you want real stability, you can track a release version of your choice.\n\n```bash\ncomposer require edmondscommerce/phpqa:dev-master@dev --dev\n```\n\nYour project's `composer.json` needs to specify a bin folder. If it's not already present, add this:\n\n```\n    ...\n    \"config\": {\n        \"bin-dir\": \"bin\"\n    }\n    ...\n``` \n\n## Running\n\nTo run the full pipline, simply execute in your BASH terminal: \n```bash\n./bin/qa \n```\n\n### Usage:\n\n```\n$ ./bin/qa -h\n\nUsage:\nbin/qa [-t tool to run ] [ -p path to scan ]\n\nDefaults to using all tools and scanning whole project based on platform\n\n - use -h to see this help\n\n - use -p to specify a specific path to scan\n\n - use -t to specify a single tool:\n     psr|psr4         psr4 validation\n     com|composer     composer validation\n     st|stricttypes   strict types validation\n     lint|phplint     phplint\n     stan|phpstan     phpstan\n     unit|phpunit     phpunit\n     infect|infection infection\n     md|messdetector  php mess detector\n     ma|markdown      markdown validation\n     bf|phpbf         php beautifier and fixer\n     cs|phpcs         php code sniffer\n     l|loc            lines of code and other stats\n\n\n```\n\nBy default, PHPQA will run against the entire project root.\n\n### Single Tool:\n\nIf you want to run a single tool, use the `-t` option. See the usage above to get the shortcuts for the tools\n\n```bash\n./bin/qa -t stan\n```\n\n### Specified Path:\n\nSome of the tools allow us to restrict the scan to a specified path. To specify the path, use the `-p` option.\n\n```bash \n./bin/qa -p ./src/specified/path.php\n```\n\n### Combined\n\nYou can combine both options\n\n```bash \n./bin/qa -t stan -p ./src/specified/path.php\n```\n \n## Configuration\n\nPlease see the [Configuration docs](./docs/configuration.md)\n\n## The Pipeline\n\nPlease see the [Pipeline docs](./docs/pipeline.md)\n\n## The QA Tools\n\nFor full details and configuration instructions for all fo the tools, please see the [PHPQA Tools](./docs/phpqa-tools.md)\n\n## Platform Detection\n\nPHPQA comes with a set of generic tools and configs, but also has some inbuilt profiles.\n\nInformation on how this works can be found on the [platform detection page](docs/platform-detection.md)\n\nSpecific platforms' docs are at:\n\n- [Magento 2](./docs/magento2.md)\n- [Laravel and Lumen](./docs/laravellumen.md)\n\n## Using for Continuous Integration (CI)\n\nPlease see the [CI docs](./docs/ci.md)\n\n## Git Hooks\n\nHave a look in [gitHooks](./gitHooks) for git hooks that can be used in your project\n\nThe suggested way to use these is to symlink. Note that your actual git hook should not include the `.bash` file extension\n\nTo use the `pre-commit` hook, for example, you would do:\n\n```bash\n#cd to project root\ncd /var/www/project/root\n\n#cd to hooks folder\ncd .git/hooks/\n\n#create relative symlink\nln -s ../../vendor/edmondscommerce/phpqa/gitHooks/pre-commit.bash pre-commit\n```\n\nThen ensure the hook is executable by running it:\n\n``` bash\n#cd to project root\ncd /var/www/project/root\n\n./git/hooks/pre-commit\n```\n\nAnd you should then see \n\n```\n===========================================\nPHPQA Pre Commit Hook\n===========================================\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedmondscommerce%2Fphpqa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedmondscommerce%2Fphpqa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedmondscommerce%2Fphpqa/lists"}