PHPackages                             edmondscommerce/phpqa - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. edmondscommerce/phpqa

ActiveProject[Testing &amp; Quality](/categories/testing)

edmondscommerce/phpqa
=====================

Simple PHP QA pipeline and scripts. Largely just a collection of dependencies with configuration and scripts to run them together

4.2.3(5y ago)522.8k2[12 issues](https://github.com/edmondscommerce/phpqa/issues)[2 PRs](https://github.com/edmondscommerce/phpqa/pulls)6MITPHPPHP ^7.2|^8.0CI failing

Since Feb 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/edmondscommerce/phpqa)[ Packagist](https://packagist.org/packages/edmondscommerce/phpqa)[ RSS](/packages/edmondscommerce-phpqa/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (15)Versions (55)Used By (6)

PHPQA
=====

[](#phpqa)

By [Edmonds Commerce](https://www.edmondscommerce.co.uk)
--------------------------------------------------------

[](#by-edmonds-commerce)

Version 4 Updates
-----------------

[](#version-4-updates)

Brings in PHPStan 0.12 which is great

However you will need to do the following:

Remove PHPStan symlinks before upgrading
========================================

[](#remove-phpstan-symlinks-before-upgrading)

```
rm -f bin/phpstan*
```

Ensuring Correct PHPStan Configs
================================

[](#ensuring-correct-phpstan-configs)

If you are overriding `phpstan.neon` in your `qaConfig` folder, then you need to make sure you have this in there:

```
parameters:
    level: max
    inferPrivatePropertyTypeFromConstructor: true
```

Version 3 Updates
-----------------

[](#version-3-updates)

You should update your phpunit.xml file to use `        printerClass="\PHPUnit\Util\TestDox\CliTestDoxPrinter"`

[see ./phpunit.xml](./phpunit.xml)

Introduction
------------

[](#introduction)

PHPQA 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.

It runs tools in a logical order and will fail as quickly as possible.

PHPQA has only been tested on Linux.

[![Codacy Badge](https://camo.githubusercontent.com/629ce4fc0fc769307e8c9f21a6f2242219927b4872cba5045243d3b47bed31e7/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3838346132383462653563643464643361343963313939313139333835663538)](https://www.codacy.com/app/edmondscommerce/phpqa?utm_source=github.com&utm_medium=referral&utm_content=edmondscommerce/phpqa&utm_campaign=Badge_Grade)[![Build Status](https://camo.githubusercontent.com/74100771437b3dcb5467679da33136ce29413057c6467caccf6a337328daaf77/68747470733a2f2f7472617669732d63692e6f72672f65646d6f6e6473636f6d6d657263652f70687071612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/edmondscommerce/phpqa)[![Code Coverage](https://camo.githubusercontent.com/e4b27e9d9eec443e7b4c73f41806039b3cd4e96c62b3221c7eff3eb354fe28ce/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f65646d6f6e6473636f6d6d657263652f70687071612f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/edmondscommerce/phpqa/?branch=master)

Installing
----------

[](#installing)

You 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.

```
composer require edmondscommerce/phpqa:dev-master@dev --dev
```

Your project's `composer.json` needs to specify a bin folder. If it's not already present, add this:

```
    ...
    "config": {
        "bin-dir": "bin"
    }
    ...

```

Running
-------

[](#running)

To run the full pipline, simply execute in your BASH terminal:

```
./bin/qa
```

### Usage:

[](#usage)

```
$ ./bin/qa -h

Usage:
bin/qa [-t tool to run ] [ -p path to scan ]

Defaults to using all tools and scanning whole project based on platform

 - use -h to see this help

 - use -p to specify a specific path to scan

 - use -t to specify a single tool:
     psr|psr4         psr4 validation
     com|composer     composer validation
     st|stricttypes   strict types validation
     lint|phplint     phplint
     stan|phpstan     phpstan
     unit|phpunit     phpunit
     infect|infection infection
     md|messdetector  php mess detector
     ma|markdown      markdown validation
     bf|phpbf         php beautifier and fixer
     cs|phpcs         php code sniffer
     l|loc            lines of code and other stats

```

By default, PHPQA will run against the entire project root.

### Single Tool:

[](#single-tool)

If you want to run a single tool, use the `-t` option. See the usage above to get the shortcuts for the tools

```
./bin/qa -t stan
```

### Specified Path:

[](#specified-path)

Some of the tools allow us to restrict the scan to a specified path. To specify the path, use the `-p` option.

```
./bin/qa -p ./src/specified/path.php
```

### Combined

[](#combined)

You can combine both options

```
./bin/qa -t stan -p ./src/specified/path.php
```

Configuration
-------------

[](#configuration)

Please see the [Configuration docs](./docs/configuration.md)

The Pipeline
------------

[](#the-pipeline)

Please see the [Pipeline docs](./docs/pipeline.md)

The QA Tools
------------

[](#the-qa-tools)

For full details and configuration instructions for all fo the tools, please see the [PHPQA Tools](./docs/phpqa-tools.md)

Platform Detection
------------------

[](#platform-detection)

PHPQA comes with a set of generic tools and configs, but also has some inbuilt profiles.

Information on how this works can be found on the [platform detection page](docs/platform-detection.md)

Specific platforms' docs are at:

- [Magento 2](./docs/magento2.md)
- [Laravel and Lumen](./docs/laravellumen.md)

Using for Continuous Integration (CI)
-------------------------------------

[](#using-for-continuous-integration-ci)

Please see the [CI docs](./docs/ci.md)

Git Hooks
---------

[](#git-hooks)

Have a look in [gitHooks](./gitHooks) for git hooks that can be used in your project

The suggested way to use these is to symlink. Note that your actual git hook should not include the `.bash` file extension

To use the `pre-commit` hook, for example, you would do:

```
#cd to project root
cd /var/www/project/root

#cd to hooks folder
cd .git/hooks/

#create relative symlink
ln -s ../../vendor/edmondscommerce/phpqa/gitHooks/pre-commit.bash pre-commit
```

Then ensure the hook is executable by running it:

```
#cd to project root
cd /var/www/project/root

./git/hooks/pre-commit
```

And you should then see

```
===========================================
PHPQA Pre Commit Hook
===========================================

```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 89.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~23 days

Recently: every ~62 days

Total

46

Last Release

2004d ago

Major Versions

1.2.11 → 2.0.52019-01-16

1.2.12 → 2.0.82019-01-30

1.2.x-dev → 2.0.92019-03-15

2.0.11 → 3.0.02019-04-02

3.1.0 → 4.0.02019-12-06

PHP version history (4 changes)0.0.3PHP ~7

1.1.0PHP ~7.1

3.0.0PHP ^7.2

4.2.0PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7af407ceeb8622c9c164d386ef3e95cda4c94d141240348ac5703223bb499d0e?d=identicon)[edmondscommerce](/maintainers/edmondscommerce)

---

Top Contributors

[![edmondscommerce](https://avatars.githubusercontent.com/u/62842?v=4)](https://github.com/edmondscommerce "edmondscommerce (364 commits)")[![rossmitchell](https://avatars.githubusercontent.com/u/7073145?v=4)](https://github.com/rossmitchell "rossmitchell (35 commits)")[![everon](https://avatars.githubusercontent.com/u/375251?v=4)](https://github.com/everon "everon (5 commits)")[![tahirqureshi](https://avatars.githubusercontent.com/u/73536349?v=4)](https://github.com/tahirqureshi "tahirqureshi (1 commits)")

---

Tags

bashcoverage-reportphpphp-qaphpunitpipelineqa-processsniffertravis

### Embed Badge

![Health badge](/badges/edmondscommerce-phpqa/health.svg)

```
[![Health](https://phpackages.com/badges/edmondscommerce-phpqa/health.svg)](https://phpackages.com/packages/edmondscommerce-phpqa)
```

###  Alternatives

[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M343](/packages/drupal-core-dev)[wp-cli/wp-cli-tests

WP-CLI testing framework

423.1M142](/packages/wp-cli-wp-cli-tests)[ec-europa/toolkit

Toolkit packaged for Drupal projects based on Robo.

40252.8k34](/packages/ec-europa-toolkit)[youwe/testing-suite

Contains Youwe's default testing packages for php.

13191.0k8](/packages/youwe-testing-suite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
