PHPackages                             terminal42/code-quality-tools - 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. terminal42/code-quality-tools

ActiveComposer-plugin

terminal42/code-quality-tools
=============================

Highly opinionated code quality tools for terminal42 projects.

01.6k↑925%1[1 PRs](https://github.com/terminal42/code-quality-tools/pulls)2PHPCI failing

Since Jul 27Pushed 1mo agoCompare

[ Source](https://github.com/terminal42/code-quality-tools)[ Packagist](https://packagist.org/packages/terminal42/code-quality-tools)[ RSS](/packages/terminal42-code-quality-tools/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (2)

Code quality tools
==================

[](#code-quality-tools)

Shared, opinionated code-quality configuration for terminal42 projects. Each tool is installed in its own directory, so its dependencies do not conflict with those of the consuming project.

Installation
------------

[](#installation)

Install the Composer plugin as a development dependency:

```
composer require --dev terminal42/code-quality-tools
```

Allow the plugin when Composer asks. For non-interactive installations, add it explicitly:

```
{
    "config": {
        "allow-plugins": {
            "terminal42/code-quality-tools": true
        }
    }
}
```

The plugin installs and updates the isolated dependencies below `vendor/terminal42/code-quality-tools/tools/` whenever Composer runs in development mode.

PHP tools
---------

[](#php-tools)

Add the tools required by the project to the `scripts` section of its `composer.json`. A typical PHP project uses ECS, Rector, and PHPStan:

```
{
    "scripts": {
        "cs-fixer": "@php vendor/terminal42/code-quality-tools/tools/ecs/vendor/bin/ecs check src tests --config vendor/terminal42/code-quality-tools/tools/ecs/config.php --fix --ansi",
        "rector": "@php vendor/terminal42/code-quality-tools/tools/rector/vendor/bin/rector process src tests --config vendor/terminal42/code-quality-tools/tools/rector/config.php --ansi",
        "phpstan": "@php vendor/terminal42/code-quality-tools/tools/phpstan/vendor/bin/phpstan analyze src tests --configuration vendor/terminal42/code-quality-tools/tools/phpstan/config.php --ansi",
        "code-quality": [
            "@cs-fixer",
            "@rector",
            "@phpstan"
        ]
    }
}
```

Adjust `src`, `tests`, and the other paths to match the project. Run all configured checks with:

```
composer run code-quality
```

The other bundled PHP tools can be added in the same way:

```
{
    "scripts": {
        "composer-dependencies": "@php vendor/terminal42/code-quality-tools/tools/composer-dependency-analyser/vendor/bin/composer-dependency-analyser --config vendor/terminal42/code-quality-tools/tools/composer-dependency-analyser/config.php",
        "twig-cs-fixer": "@php vendor/terminal42/code-quality-tools/tools/twig-cs-fixer/vendor/bin/twig-cs-fixer fix templates --config vendor/terminal42/code-quality-tools/tools/twig-cs-fixer/config.php",
        "yaml-lint": "@php vendor/terminal42/code-quality-tools/tools/yamllint/vendor/bin/yaml-lint config .github"
    }
}
```

Projects may extend the shared configuration through these local files:

- `ecs.php`
- `rector.php`
- `phpstan.neon`, `phpstan.neon.dist`, `phpstan.dist.neon`, or `phpstan-baseline.neon`
- `composer-dependency-analyser.php`

JavaScript and CSS tools
------------------------

[](#javascript-and-css-tools)

Biome, ESLint, and Stylelint are also installed in isolated tool directories. Add only the commands relevant to the project and adjust the target paths or globs as needed:

```
{
    "scripts": {
        "biome": "vendor/terminal42/code-quality-tools/tools/biome/node_modules/.bin/biome check assets layout --config-path vendor/terminal42/code-quality-tools/tools/biome/biome.json --write",
        "eslint": "vendor/terminal42/code-quality-tools/tools/eslint/node_modules/.bin/eslint assets layout --config vendor/terminal42/code-quality-tools/tools/eslint/eslint.config.js --fix",
        "stylelint": "vendor/terminal42/code-quality-tools/tools/stylelint/node_modules/.bin/stylelint \"assets/**/*.{css,scss}\" \"layout/**/*.{css,scss}\" --config vendor/terminal42/code-quality-tools/tools/stylelint/stylelint.config.js --fix",
        "code-quality": [
            "@biome",
            "@eslint",
            "@stylelint"
        ]
    }
}
```

When combining PHP and Node tools, keep a single `code-quality` array containing every selected script alias.

The shared ESLint configuration additionally reads `.eslintrc.json`, while Stylelint reads `.stylelintrc`, when those files exist in the project root.

Add a root `package.json` when using the Node-based tools so the reusable workflow sets up Node.js and installs the project's own packages as well.

GitHub Actions
--------------

[](#github-actions)

Create `.github/workflows/code-quality.yml` in the consuming project:

```
name: Code Quality

on:
    push: ~
    pull_request: ~

permissions: read-all

jobs:
    code-quality:
        uses: 'terminal42/code-quality-tools/.github/workflows/code-quality.yml@main'
```

The reusable workflow installs the project dependencies and runs `composer run code-quality`. Every script referenced by `code-quality` must therefore be available in the project.

###  Health Score

28

—

LowBetter than 51% of packages

Maintenance61

Regular maintenance activity

Popularity23

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 57.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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1073273?v=4)[Andreas Schempp](/maintainers/aschempp)[@aschempp](https://github.com/aschempp)

![](https://avatars.githubusercontent.com/u/481937?v=4)[Yanick Witschi](/maintainers/Toflar)[@Toflar](https://github.com/Toflar)

---

Top Contributors

[![Toflar](https://avatars.githubusercontent.com/u/481937?v=4)](https://github.com/Toflar "Toflar (11 commits)")[![aschempp](https://avatars.githubusercontent.com/u/1073273?v=4)](https://github.com/aschempp "aschempp (8 commits)")

### Embed Badge

![Health badge](/badges/terminal42-code-quality-tools/health.svg)

```
[![Health](https://phpackages.com/badges/terminal42-code-quality-tools/health.svg)](https://phpackages.com/packages/terminal42-code-quality-tools)
```

PHPackages © 2026

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