PHPackages                             ctw/ctw-qa - 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. ctw/ctw-qa

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

ctw/ctw-qa
==========

Configuration for commonly used quality assurance (QA) tools for PHP projects.

6.0.2(3w ago)02.9k↑27.8%17proprietaryPHPPHP ^8.4CI passing

Since Jun 11Pushed 3w ago1 watchersCompare

[ Source](https://github.com/jonathanmaron/ctw-qa)[ Packagist](https://packagist.org/packages/ctw/ctw-qa)[ RSS](/packages/ctw-ctw-qa/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (32)Versions (58)Used By (17)

Package "ctw/ctw-qa"
====================

[](#package-ctwctw-qa)

[![Latest Stable Version](https://camo.githubusercontent.com/4115af159ac356195e45fc6d3a08f8c32d24e54f0a789a9e3b2168801e80f072/68747470733a2f2f706f7365722e707567782e6f72672f6374772f6374772d71612f762f737461626c65)](https://packagist.org/packages/ctw/ctw-qa)[![GitHub Actions](https://github.com/jonathanmaron/ctw-qa/actions/workflows/ci.yml/badge.svg)](https://github.com/jonathanmaron/ctw-qa/actions/workflows/ci.yml)

Centralized, opinionated configuration for PHP 8.3+ quality assurance tools: Rector, Easy Coding Standard (ECS), and PHPStan.

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

[](#introduction)

### Why This Library Exists

[](#why-this-library-exists)

Setting up quality assurance tools properly is tedious and error-prone. Each project requires configuring:

- **Rector** for code modernization (100+ lines of configuration)
- **Easy Coding Standard** for style enforcement (150+ lines)
- **PHPStan** for static analysis (50+ lines)

Multiplied across numerous projects, this becomes a maintenance burden. Configurations drift, standards diverge, and teams waste time debugging tool setups instead of writing code.

This library provides:

- **Battle-tested defaults**: Years of PHP best practices encoded in reusable configuration classes
- **PHP 8.3+ standards**: Modern PHP syntax, strict types, and property promotion
- **PSR-12 compliance**: Full adherence to PHP coding standards
- **Extensible architecture**: Override any default via class inheritance
- **Consistent tooling**: Identical QA configuration across all projects

### Problems This Library Solves

[](#problems-this-library-solves)

1. **Configuration drift**: Projects diverge in coding standards over time
2. **Repetitive setup**: Same boilerplate written for every new project
3. **Inconsistent quality**: Different strictness levels across codebases
4. **Maintenance burden**: Tool updates require changes in multiple places
5. **Onboarding friction**: New developers must learn project-specific configurations

### Where to Use This Library

[](#where-to-use-this-library)

- **New PHP projects**: Start with modern, strict standards from day one
- **Existing codebases**: Gradually modernize legacy code with Rector
- **Monorepos**: Share identical QA configuration across all packages
- **CI/CD pipelines**: Automated quality gates with consistent rules
- **Open source libraries**: Enforce professional-grade code quality

### Design Goals

[](#design-goals)

1. **Opinionated defaults**: Strong opinions for modern PHP, easily overridable
2. **Invokable classes**: Simple `$config()` syntax for integration
3. **Maximum strictness**: PHPStan level `max`, strict comparisons, strict types
4. **Minimal dependencies**: Only the three QA tools themselves
5. **Extensible**: All configuration classes designed for inheritance

Requirements
------------

[](#requirements)

- PHP 8.3 or higher
- Composer

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

[](#installation)

Install by adding the package as a [Composer](https://getcomposer.org) requirement:

```
composer require ctw/ctw-qa --dev
```

Usage Examples
--------------

[](#usage-examples)

### Rector Configuration

[](#rector-configuration)

Create `rector.php` in your project root:

```
