Download the PHP package ctw/ctw-qa without Composer
On this page you can find all versions of the php package ctw/ctw-qa. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package ctw-qa
Short Description Configuration for commonly used quality assurance (QA) tools for PHP projects.
License proprietary
Informations about the package ctw-qa
Package "ctw/ctw-qa"
Centralized, opinionated configuration for PHP 8.3+ quality assurance tools: Rector, Easy Coding Standard (ECS), and PHPStan.
Introduction
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
- Configuration drift: Projects diverge in coding standards over time
- Repetitive setup: Same boilerplate written for every new project
- Inconsistent quality: Different strictness levels across codebases
- Maintenance burden: Tool updates require changes in multiple places
- Onboarding friction: New developers must learn project-specific configurations
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
- Opinionated defaults: Strong opinions for modern PHP, easily overridable
- Invokable classes: Simple
$config()syntax for integration - Maximum strictness: PHPStan level
max, strict comparisons, strict types - Minimal dependencies: Only the three QA tools themselves
- Extensible: All configuration classes designed for inheritance
Requirements
- PHP 8.3 or higher
- Composer
Installation
Install by adding the package as a Composer requirement:
Usage Examples
Rector Configuration
Create rector.php in your project root:
ECS Configuration
Create ecs.php in your project root:
PHPStan Configuration
Create phpstan.neon in your project root:
Composer Scripts
Add to your composer.json:
Run QA checks:
Included Rule Sets
Rector (Code Modernization)
| Set | Description |
|---|---|
UP_TO_PHP_83 |
Modernizes code to PHP 8.3 syntax |
PHPUNIT_100 |
Upgrades PHPUnit to version 10.0+ |
CODE_QUALITY |
Simplifies expressions, removes redundancy |
CODING_STYLE |
Enforces consistent style |
DEAD_CODE |
Removes unused code |
NAMING |
Improves naming conventions |
ECS (Code Style)
| Rule | Description |
|---|---|
DeclareStrictTypesFixer |
Adds declare(strict_types=1) |
DisallowLongArraySyntaxSniff |
Enforces short array syntax [] |
StrictComparisonFixer |
Enforces === over == |
NoUnusedImportsFixer |
Removes unused imports |
OrderedImportsFixer |
Alphabetizes imports |
TrailingCommaInMultilineFixer |
Adds trailing commas |
PHPStan (Static Analysis)
- Level:
max(strictest) - Strict rules enabled
- PHPUnit extension included
Customization
Extend any configuration class to modify defaults:
Use your custom class:
All versions of ctw-qa with dependencies
phpstan/extension-installer Version ^1.4
phpstan/phpstan Version ^2.0
phpstan/phpstan-phpunit Version ^2.0
phpstan/phpstan-strict-rules Version ^2.0
rector/rector Version ^2.0
symplify/easy-coding-standard Version ^13.0


