PHPackages                             spaceonfire/easy-coding-standard-bridge - 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. spaceonfire/easy-coding-standard-bridge

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

spaceonfire/easy-coding-standard-bridge
=======================================

Easy Coding Standard Bridge by spaceonfire

2.5.2(4y ago)18411MITPHPPHP ^7.2|^8.0

Since Apr 21Pushed 4y ago1 watchersCompare

[ Source](https://github.com/spaceonfire/easy-coding-standard-bridge)[ Packagist](https://packagist.org/packages/spaceonfire/easy-coding-standard-bridge)[ Docs](https://github.com/spaceonfire/easy-coding-standard-bridge)[ Fund](https://liberapay.com/hustlahusky)[ RSS](/packages/spaceonfire-easy-coding-standard-bridge/feed)WikiDiscussions 2.5.x Synced today

READMEChangelogDependencies (4)Versions (5)Used By (0)

Easy Coding Standard Bridge by spaceonfire
==========================================

[](#easy-coding-standard-bridge-by-spaceonfire)

[![Latest Version on Packagist](https://camo.githubusercontent.com/27831eef00598a0e750bb283545b0cddcda6f929e4c79b284b5ab0a313834406/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73706163656f6e666972652f656173792d636f64696e672d7374616e646172642d6272696467652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spaceonfire/easy-coding-standard-bridge)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/b713d51f97b7da498372a5817ee50b729e40145b86a49d79fc4eb82338c24200/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73706163656f6e666972652f656173792d636f64696e672d7374616e646172642d6272696467652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spaceonfire/easy-coding-standard-bridge)

Установка
---------

[](#установка)

Установите зависимости для разработки:

```
composer require --dev spaceonfire/easy-coding-standard-bridge symplify/easy-coding-standard symfony/var-exporter
```

Добавить скрипт в `composer.json`

```
{
    "scripts": {
        "codestyle": "@php -d xdebug.mode=off `which ecs` check --ansi"
    }
}
```

Использование
-------------

[](#использование)

Чтобы скопировать базовые конфиги для Easy Coding Standard и EditorConfig, выполните команду из директории репозитория.

```
vendor/bin/ecs-init.php
```

После этого у вас появятся файлы `.editorconfig` и `ecs.php`. Доработайте конфиг `ecs.php` под нужды проекта, укажите директории с кодом для анализа.

Внедрение на действующий проект
-------------------------------

[](#внедрение-на-действующий-проект)

После инициализации конфига на действующем проекте `ecs` найдет массу ошибок в кодовой базе, не все из которых он может решить автоматически при использовании ключа `--fix`. В этом случае можно просто принять все эти ошибки как "baseline" и игнорировать их при анализе. Это позволяет упростить процесс внедрения инструмента и начать писать новый код применяя стандарты.

Для создания "baseline" конфига необходимо сначала собрать ошибки в формате JSON:

```
vendor/bin/ecs check --output-format=json > ecs-baseline-errors.json
```

После этого запустить команду для генерации "baseline" конфига на основе полученного JSON файла:

```
vendor/bin/ecs-baseliner.php ecs-baseline-errors.json
```

Эта команда создаст файл `ecs-baseline.php` в рабочей директории. Его необходимо подключить в файле `ecs.php`(по-умолчанию он уже подключен в шаблоне). После чего можно проверить что ошибки игнорируются.

Если после этого `ecs` снова найдет ошибки, повторите сбор ошибок в новый файл (например, `ecs-baseline-errors.2.json`) и повторите генерацию "baseline" конфига с указанием всех файлов ошибок. Повторите эти шаги, пока `ecs` не перестанет выводить ошибки.

```
vendor/bin/ecs-baseliner.php ecs-baseline-errors.json ecs-baseline-errors.2.json
```

После внедрения "baseline" конфига не забывайте при редактировании legacy кода убирать файлы из "baseline" конфига и исправлять ошибки, тем самым постепенно приводя кодовую базу проекта в соответствие стандартам.

Запуск в CI/CD
--------------

[](#запуск-в-cicd)

Пример задания для запуска проверки кода в GitLab CI/CD:

```
stages:
    - test

.in-docker-job:
    tags:
        - docker
    image: alpine

.php-job:
    extends: .in-docker-job
    image: spaceonfire/nginx-php-fpm:latest-7.4

.composer-job:
    extends: .php-job
    before_script:
        - composer install
    cache:
        key: composer
        paths:
            - vendor
            - $COMPOSER_CACHE_DIR
    variables:
        COMPOSER_CACHE_DIR: "$CI_PROJECT_DIR/._composer-cache"

codestyle:
    extends: .composer-job
    stage: test
    script:
        - composer codestyle -- --no-progress-bar --no-interaction
```

При указании docker образа, в котором будет выполняться задание, вместо `spaceonfire/nginx-php-fpm:latest-7.4` можно указать тег с версией php для проекта (доступны `7.2`, `7.3`, `7.4`) либо другой образ с `php` и `composer`.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

[Report issues](https://github.com/spaceonfire/spaceonfire/issues) and [send Pull Requests](https://github.com/spaceonfire/spaceonfire/pulls) in the [main spaceonfire repository](https://github.com/spaceonfire/spaceonfire). Please see [CONTRIBUTING](https://github.com/spaceonfire/spaceonfire/blob/master/CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](https://github.com/spaceonfire/spaceonfire/blob/master/CODE_OF_CONDUCT.md) for details.

Credits
-------

[](#credits)

- [Constantine Karnaukhov](https://github.com/hustlahusky)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~78 days

Total

5

Last Release

1585d ago

Major Versions

2.5.x-dev → 3.0.x-dev2022-02-28

PHP version history (2 changes)2.5.0PHP ^7.2|^8.0

3.0.x-devPHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3947942?v=4)[Constantine Karnaukhov](/maintainers/tntrex)[@tntrex](https://github.com/tntrex)

---

Top Contributors

[![tntrex](https://avatars.githubusercontent.com/u/3947942?v=4)](https://github.com/tntrex "tntrex (5 commits)")

---

Tags

Code stylebaselineeditorconfigpsr-12code standardeasy-coding-standard

###  Code Quality

Code StyleECS

### Embed Badge

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

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

###  Alternatives

[typo3/coding-standards

A set of coding guidelines for any TYPO3-related project or extension

683.1M599](/packages/typo3-coding-standards)[malukenho/docheader

A small library to check header docs

68417.4k139](/packages/malukenho-docheader)[jubeki/laravel-code-style

Combine Custom Fixers with the ruleset of Laravel Pint to fix your code style in Laravel Applications/Packages.

56570.4k8](/packages/jubeki-laravel-code-style)[shopsys/coding-standards

Coding standards definition compatible with PSR-2

20280.7k20](/packages/shopsys-coding-standards)[codelytv/coding-style

PHP Coding Style rules we use in Codely

5736.6k8](/packages/codelytv-coding-style)[forrest79/phpcs-ignores

PHPCS-Ignores provides functionality to use baseline or other ignoring for original PHPCS.

1143.5k21](/packages/forrest79-phpcs-ignores)

PHPackages © 2026

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