PHPackages                             php-forge/coding-standard - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. php-forge/coding-standard

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

php-forge/coding-standard
=========================

Centralized ECS and Rector configurations for PHP projects.

0.3.2(1mo ago)271.7k↓44.9%20BSD-3-ClausePHPPHP &gt;=8.1CI passing

Since Jan 24Pushed 1mo agoCompare

[ Source](https://github.com/php-forge/coding-standard)[ Packagist](https://packagist.org/packages/php-forge/coding-standard)[ RSS](/packages/php-forge-coding-standard/feed)WikiDiscussions main Synced yesterday

READMEChangelog (5)Dependencies (10)Versions (14)Used By (20)

 [ ![PHP Forge](https://avatars.githubusercontent.com/u/103309199?s%25253D400%252526u%25253Dca3561c692f53ed7eb290d3bb226a2828741606f%252526v%25253D4) ](https://github.com/php-forge/coding-standard)

Coding standard
===============

[](#coding-standard)

 **Centralized ECS and Rector configuration for PHP projects**
 *Share one set of rules across multiple repositories via Composer.*

System requirements
-------------------

[](#system-requirements)

- [`PHP`](https://www.php.net/downloads) 8.1 or higher.
- [`Composer`](https://getcomposer.org/download/) for dependency management.

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

[](#installation)

```
composer require php-forge/coding-standard:^0.3 --dev
```

Or add the dependency manually to `composer.json`:

```
{
    "require-dev": {
        "php-forge/coding-standard": "^0.3"
    }
}
```

Then run `composer update`.

Configuration files
-------------------

[](#configuration-files)

This package ships shared ECS and Rector configurations under `vendor/php-forge/coding-standard/src/`:

FilePurpose`src/ecs.php`Shared ECS base rules, no PHP migration set`src/ecs-81.php`Base + `@PHP81Migration` PHP-CS-Fixer set`src/ecs-82.php`Base + `@PHP82Migration``src/ecs-83.php`Base + `@PHP83Migration``src/ecs-84.php`Base + `@PHP84Migration``src/rector.php`Shared Rector base rules, no PHP level set`src/rector-81.php`Base + `SetList::PHP_81` + `LevelSetList::UP_TO_PHP_81``src/rector-82.php`Base + `SetList::PHP_82` + `LevelSetList::UP_TO_PHP_82``src/rector-83.php`Base + `SetList::PHP_83` + `LevelSetList::UP_TO_PHP_83``src/rector-84.php`Base + `SetList::PHP_84` + `LevelSetList::UP_TO_PHP_84`Pick the version that matches the **minimum** PHP your project supports; Rector upgrades code up to that level and PHP-CS-Fixer enforces matching syntax. The plain `ecs.php` / `rector.php` apply no PHP-version migrations.

### ECS wrapper (ecs.php)

[](#ecs-wrapper-ecsphp)

Create `ecs.php` in your repository root, requiring the version that matches the minimum PHP your project supports (`ecs-83.php` for PHP 8.3, etc.):

```
