PHPackages                             wpelevator/phpcs-parallel - 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. wpelevator/phpcs-parallel

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

wpelevator/phpcs-parallel
=========================

Run PHPCS and PHPCBF across monorepos with isolated per-project configs, optionally in parallel.

1.0.0(today)00[1 PRs](https://github.com/wpelevator/phpcs-parallel/pulls)MITPHPPHP &gt;=8.1CI passing

Since Jul 1Pushed todayCompare

[ Source](https://github.com/wpelevator/phpcs-parallel)[ Packagist](https://packagist.org/packages/wpelevator/phpcs-parallel)[ RSS](/packages/wpelevator-phpcs-parallel/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (4)Versions (2)Used By (0)

phpcs-parallel
==============

[](#phpcs-parallel)

[![Test](https://github.com/wpelevator/phpcs-parallel/actions/workflows/ci.yml/badge.svg)](https://github.com/wpelevator/phpcs-parallel/actions/workflows/ci.yml)

Run [PHPCS](https://github.com/PHPCSStandards/PHP_CodeSniffer/) once per project ruleset, optionally in parallel.

This is useful for monorepos where each package has its own `phpcs.xml.dist`. Instead of merging those rulesets into one PHPCS run, `phpcs-parallel` runs an isolated PHPCS process for each matched config.

Install
-------

[](#install)

```
composer require --dev wpelevator/phpcs-parallel
```

Usage
-----

[](#usage)

Run PHPCS for every matched config:

```
vendor/bin/phpcs-parallel --config-pattern='packages/*' --processes=4
```

Pass PHPCS options after `--`:

```
vendor/bin/phpcs-parallel --config-pattern='packages/*' --processes=4 -- -s --report=summary
```

Run PHPCBF the same way:

```
vendor/bin/phpcbf-parallel --config-pattern='packages/*' --processes=4
```

You can repeat `--config-pattern` or provide comma-separated patterns. Patterns are shell-style globs matched with PHP `fnmatch()`, not regular expressions. They may match either project directories or config files:

```
vendor/bin/phpcs-parallel --config-pattern='packages/*' --config-pattern='apps/*/phpcs.xml.dist'

vendor/bin/phpcs-parallel --config-pattern='packages/*,apps/*/phpcs.xml.dist'
```

Each matched config runs as:

```
phpcs --standard=/path/to/package/phpcs.xml.dist /path/to/package
```

Config resolution
-----------------

[](#config-resolution)

When project directories are provided explicitly, each directory uses the first config found in that directory, falling back to the nearest parent config. Config names are checked in this order:

1. `.phpcs.xml`
2. `phpcs.xml`
3. `.phpcs.xml.dist`
4. `phpcs.xml.dist`

When no project directories are provided, the current working directory is recursively searched for matching config files. `--config-pattern` can match either project directory paths or config file paths. Patterns use shell-style glob syntax, for example `packages/*` or `apps/*/phpcs.xml.dist`; regex syntax such as `packages/(foo|bar)` or `packages/.+` is not supported. Passing both project directories and `--config-pattern` combines explicit projects with discovered projects and deduplicates them by project root.

Composer scripts
----------------

[](#composer-scripts)

```
{
  "scripts": {
    "lint": "phpcs-parallel --config-pattern='packages/*' --processes=4 -- -s",
    "format": "phpcbf-parallel --config-pattern='packages/*' --processes=4"
  }
}
```

Example
-------

[](#example)

The [`example`](example) directory contains a small monorepo with two packages, each using a different ruleset (`PSR12` and `WordPress`), wired up via `composer.json` `lint`/`format` scripts:

```
cd example
composer install
composer lint
composer format
```

Development
-----------

[](#development)

Run the same checks used by CI:

```
composer lint
composer analyse
composer test
```

Run a specific test suite:

```
vendor/bin/phpunit --testsuite Unit
vendor/bin/phpunit --testsuite Integration
```

Generate PHPUnit coverage reports (requires Xdebug or PCOV):

```
composer test:coverage
```

Coverage output is written to the terminal, `tests/coverage/clover.xml`, and `tests/coverage/html`.

Notes
-----

[](#notes)

- Dependency directories are skipped during discovery: `.git`, `vendor`, `node_modules`, `bower_components`.
- The wrapper returns the highest child exit code for PHPCS/PHPCBF lint/fix results. Runtime/tool errors are promoted to at least exit code `3`.
- Child process output is streamed through Symfony Console and prefixed with the project label.
- Use explicit project directories instead of patterns if needed: `vendor/bin/phpcs-parallel packages/foo packages/bar`.

License
-------

[](#license)

This project is open-sourced under the MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/169055?v=4)[Kaspars Dambis](/maintainers/kasparsd)[@kasparsd](https://github.com/kasparsd)

---

Top Contributors

[![kasparsd](https://avatars.githubusercontent.com/u/169055?v=4)](https://github.com/kasparsd "kasparsd (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wpelevator-phpcs-parallel/health.svg)

```
[![Health](https://phpackages.com/badges/wpelevator-phpcs-parallel/health.svg)](https://phpackages.com/packages/wpelevator-phpcs-parallel)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[brianium/paratest

Parallel testing for PHP

2.5k136.1M956](/packages/brianium-paratest)[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k16.7M1.0k](/packages/phpro-grumphp)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M293](/packages/laravel-horizon)[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k28.9M2.3k](/packages/infection-infection)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)

PHPackages © 2026

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