The qa script will be installed in your project's bin directory. By default, Composer uses vendor/bin, but you can configure a custom location in your composer.json:
"config": {
"bin-dir": "bin", // Optional: changes from vendor/bin to bin
Then install the current bleeding edge, run
composer require --dev lts/php-qa-ci:dev-master@dev
For Symfony - you can accept the prompts to run recipes, but you will then need to decide to either stick with Symfony defaults or the php-qa-ci default which are more extensive
If you decide to stick with the lts defaults, then you should remove the config files that the symfony recipe created. If you want to keep config files in your root directory, you can choose to symlink them to the php-qa-ci files, eg
Note that you should properly compare the files before doing this.
# revert to php-qa-ci PHPUnit configs
rm phpunit.xml.dist
ln -s vendor/lts/php-qa-ci/configDefaults/generic/phpunit.xml
PHP-QA-CI is a quality assurance and continuous integration 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.
It runs tools in a logical order and will fail as quickly as possible.
This package is written for and has only been tested on Linux.
PHP-QA-CI includes convenient scripts for setting up continuous integration and branch protection:
Automatically install GitHub Actions workflow for continuous integration:
# Run from your project root
vendor/lts/php-qa-ci/scripts/install-github-actions.bashThis script will:
- Create
.github/workflows/qa.ymlwith optimized QA pipeline - Auto-detect your PHP version from
composer.json - Configure smart caching for faster builds
- Set up artifact storage for test results
After installation, the QA pipeline will run automatically on all pushes and pull requests.
Configure GitHub branch protection rules with sensible defaults:
# Standard protection (admins can bypass)
vendor/lts/php-qa-ci/scripts/setup-branch-protection.bash
# Hardened protection (CI enforced for everyone)
vendor/lts/php-qa-ci/scripts/setup-branch-protection.bash --hardenThe script configures:
- Required CI checks (PHP QA Pipeline must pass)
- PR review requirements
- Protection against force pushes and deletions
- Auto-delete merged branches
- Conversation resolution requirements
Prerequisites: Requires GitHub CLI (gh) installed and authenticated.
Comprehensive documentation is available in the ./docs folder:
- GitHub Actions Integration - Complete CI/CD setup guide with customization options
- Pipeline Architecture - Detailed tool execution order and phases
- Configuration - Customizing tool settings and overrides
- Coding Standards - PHP CS Fixer and Rector configuration
- Platform Detection - Symfony/Laravel specific settings
if you are running multiple PHP versions, you can specify which one to use like so:
# If using default vendor/bin location:
export PHP_QA_CI_PHP_EXECUTABLE=/bin/php81
vendor/bin/qa
# Or inline:
PHP_QA_CI_PHP_EXECUTABLE=/bin/php81 vendor/bin/qa
# If you configured "bin-dir": "bin" in composer.json:
PHP_QA_CI_PHP_EXECUTABLE=/bin/php81 bin/qaThis package was brought to you by Long Term Support LTD, a company run and founded by Joseph Edmonds
You can get in touch with Joseph at https://joseph.edmonds.contact/
Check out Joseph's recent book The Art of Modern PHP 8