PHPackages                             symplify/easy-coding-standard-prefixed - 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. symplify/easy-coding-standard-prefixed

Abandoned → [symplify/easy-coding-standard](/?search=symplify%2Feasy-coding-standard)Library[Utility &amp; Helpers](/categories/utility)

symplify/easy-coding-standard-prefixed
======================================

Prefixed scoped version of ECS package

v9.3.1(5y ago)4228.9k↑119.7%26MITPHPPHP &gt;=7.3CI failing

Since Jan 20Pushed 5y ago1 watchersCompare

[ Source](https://github.com/deprecated-packages/easy-coding-standard-prefixed)[ Packagist](https://packagist.org/packages/symplify/easy-coding-standard-prefixed)[ RSS](/packages/symplify-easy-coding-standard-prefixed/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (205)Used By (6)

The Easiest Way to Use Any Coding Standard
==========================================

[](#the-easiest-way-to-use-any-coding-standard)

[![Downloads total](https://camo.githubusercontent.com/fc6c4db90af5f2574561e49cc104e37b7b28236358367e7da43e20e46d2904f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73796d706c6966792f656173792d636f64696e672d7374616e646172642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/symplify/easy-coding-standard/stats)

[![ECS-Run](docs/run-and-fix.gif)](docs/run-and-fix.gif)

Features
--------

[](#features)

- Use [PHP\_CodeSniffer || PHP-CS-Fixer](https://tomasvotruba.com/blog/2017/05/03/combine-power-of-php-code-sniffer-and-php-cs-fixer-in-3-lines/) - anything you like
- **2nd run under few seconds** with un-changed file cache
- Skipping files for specific checkers
- Prepared sets - PSR12, Symfony, Common, Array, Symplify and more...
- [Prefixed version](https://github.com/symplify/easy-coding-standard-prefixed) in case of conflicts on install

Are you already using another tool?

- [How to Migrate From PHP\_CodeSniffer to EasyCodingStandard in 7 Steps](https://www.tomasvotruba.com/blog/2018/06/04/how-to-migrate-from-php-code-sniffer-to-easy-coding-standard/#comment-4086561141)
- [How to Migrate From PHP CS Fixer to EasyCodingStandard in 6 Steps](https://www.tomasvotruba.com/blog/2018/06/07/how-to-migrate-from-php-cs-fixer-to-easy-coding-standard/)

Install
-------

[](#install)

```
composer require symplify/easy-coding-standard --dev
```

### Prefixed Version

[](#prefixed-version)

The prefix verion can be used when there are dependancy clashes. Head over to the ["Easy Coding Standard Prefixed" repository](https://github.com/symplify/easy-coding-standard-prefixed) for more information.

```
composer require symplify/easy-coding-standard-prefixed --dev
```

Usage
-----

[](#usage)

### 1. Create Configuration and Setup Checkers

[](#1-create-configuration-and-setup-checkers)

- Create an `ecs.php` in your root directory
- Add [Sniffs](https://github.com/squizlabs/PHP_CodeSniffer)
- ...or [Fixers](https://github.com/FriendsOfPHP/PHP-CS-Fixer) you'd love to use

```
// ecs.php
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return static function (ContainerConfigurator $containerConfigurator): void {
    // A. standalone rule
    $services = $containerConfigurator->services();
    $services->set(ArraySyntaxFixer::class)
        ->call('configure', [[
            'syntax' => 'short',
        ]]);

    // B. full sets
    $containerConfigurator->import(SetList::PSR_12);
};
```

### 2. Run in CLI

[](#2-run-in-cli)

```
# dry
vendor/bin/ecs check src

# fix
vendor/bin/ecs check src --fix
```

Features
--------

[](#features-1)

How to load own config?

```
vendor/bin/ecs check src --config another-config.php
```

Configuration
-------------

[](#configuration)

Configuration can be extended with many options. Here is list of them with example values and little description what are they for:

```
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;

return static function (ContainerConfigurator $containerConfigurator): void {
    $parameters = $containerConfigurator->parameters();

    // alternative to CLI arguments, easier to maintain and extend
    $parameters->set(Option::PATHS, [__DIR__ . '/src', __DIR__ . '/tests']);

    // run single rule only on specific path
    $parameters->set(Option::ONLY, [
        ArraySyntaxFixer::class => [__DIR__ . '/src/NewCode'],
    ]);

    $parameters->set(Option::SKIP, [
        // skip paths with legacy code
        __DIR__ . '/packages/*/src/Legacy',

        ArraySyntaxFixer::class => [
            // path to file (you can copy this from error report)
            __DIR__ . '/packages/EasyCodingStandard/packages/SniffRunner/src/File/File.php',

            // or multiple files by path to match against "fnmatch()"
            __DIR__ . '/packages/*/src/Command',
        ],

        // skip rule completely
        ArraySyntaxFixer::class,

        // just single one part of the rule?
        ArraySyntaxFixer::class . '.SomeSingleOption',

        // ignore specific error message
        'Cognitive complexity for method "addAction" is 13 but has to be less than or equal to 8.',
    ]);

    // scan other file extendsions; [default: [php]]
    $parameters->set(Option::FILE_EXTENSIONS, ['php', 'phpt']);

    // configure cache paths & namespace - useful for Gitlab CI caching, where getcwd() produces always different path
    // [default: sys_get_temp_dir() . '/_changed_files_detector_tests']
    $parameters->set(Option::CACHE_DIRECTORY, '.ecs_cache');

    // [default: \Nette\Utils\Strings::webalize(getcwd())']
    $parameters->set(Option::CACHE_NAMESPACE, 'my_project_namespace');

    // indent and tabs/spaces
    // [default: spaces]
    $parameters->set(Option::INDENTATION, 'tab');

    // [default: PHP_EOL]; other options: "\n"
    $parameters->set(Option::LINE_ENDING, "\r\n");
};
```

Codings Standards in Markdown
-----------------------------

[](#codings-standards-in-markdown)

[![ECS-Run](docs/check_markdown.gif)](docs/check_markdown.gif)

How to correct PHP snippets in Markdown files?

```
vendor/bin/ecs check-markdown README.md
vendor/bin/ecs check-markdown README.md docs/rules.md

# to fix them, add --fix
vendor/bin/ecs check-markdown README.md docs/rules.md --fix
```

Do you have already paths defined in `ecs.php` config? Drop them from CLI and let ECS use those:

```
vendor/bin/ecs check-markdown --fix
```

FAQ
---

[](#faq)

### How can I see all loaded checkers?

[](#how-can-i-see-all-loaded-checkers)

```
vendor/bin/ecs show
vendor/bin/ecs show --config ...
```

### How do I clear cache?

[](#how-do-i-clear-cache)

```
vendor/bin/ecs check src --clear-cache
```

### Run on Git Diff Changed Files Only

[](#run-on-git-diff-changed-files-only)

Execution can be limited to changed files using the `process` option `--match-git-diff`:

```
vendor/bin/ecs check src --match-git-diff
```

This option will filter the files included by the configuration, creating an intersection with the files listed in `git diff`.

Your IDE Integration
--------------------

[](#your-ide-integration)

### PHPStorm

[](#phpstorm)

ECS can be used as an External Tool

[![PHPStorm Configuration](docs/phpstorm-config.png)](docs/phpstorm-config.png)

Go to `Preferences` &gt; `Tools` &gt; `External Tools` and click `+` to add a new tool.

- Name: `ecs` (Can be any value)
- Description: `easyCodingStandard` (Can be any value)
- Program: `$ProjectFileDir$/vendor/bin/ecs` (Path to `ecs` executable; On Windows path separators must be a `\`)
- Parameters: `check $FilePathRelativeToProjectRoot$` (append `--fix` to auto-fix)
- Working directory: `$ProjectFileDir$`

Press `Cmd/Ctrl` + `Shift` + `A` (Find Action), search for `ecs`, and then hit Enter. It will run `ecs` for the current file.

To run `ecs` on a directory, right click on a folder in the project browser go to external tools and select `ecs`.

You can also create a keyboard shortcut in [Preferences &gt; Keymap](https://www.jetbrains.com/help/webstorm/configuring-keyboard-and-mouse-shortcuts.html) to run `ecs`.

### Visual Studio Code

[](#visual-studio-code)

[EasyCodingStandard for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=azdanov.vscode-easy-coding-standard) extension adds support for running EasyCodingStandard inside the editor.

Tool Integration
----------------

[](#tool-integration)

ToolExtensionDescription[GrumPHP](https://github.com/phpro/grumphp)[ECS Task](https://github.com/phpro/grumphp/blob/master/doc/tasks/ecs.md)Provides a new task for GrumPHP which runs ECS
Report Issues
-------------

[](#report-issues)

In case you are experiencing a bug or want to request a new feature head over to the [Symplify monorepo issue tracker](https://github.com/symplify/symplify/issues)

Contribute
----------

[](#contribute)

The sources of this package are contained in the Symplify monorepo. We welcome contributions for this package on [symplify/symplify](https://github.com/symplify/symplify).

###  Health Score

40

—

FairBetter than 87% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

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

Every ~2 days

Total

204

Last Release

1830d ago

Major Versions

v7.3.18 → v8.0.0-beta12020-05-16

8.3.48 → 9.0.0-BETA12020-11-14

PHP version history (3 changes)v7.2.2PHP ^7.2

9.0.0-BETA1PHP &gt;=7.2

9.0.0-rc1PHP &gt;=7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/924196?v=4)[Tomas Votruba](/maintainers/TomasVotruba)[@TomasVotruba](https://github.com/TomasVotruba)

---

Top Contributors

[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (1148 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (37 commits)")[![c33s](https://avatars.githubusercontent.com/u/649209?v=4)](https://github.com/c33s "c33s (1 commits)")[![dxops](https://avatars.githubusercontent.com/u/1804871?v=4)](https://github.com/dxops "dxops (1 commits)")

---

Tags

coding-standardecsphp-code-snifferphp-cs-fixerprefixedpsr-12

### Embed Badge

![Health badge](/badges/symplify-easy-coding-standard-prefixed/health.svg)

```
[![Health](https://phpackages.com/badges/symplify-easy-coding-standard-prefixed/health.svg)](https://phpackages.com/packages/symplify-easy-coding-standard-prefixed)
```

PHPackages © 2026

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