mwx/coding-standard

metaworx PHP coding standard: ECS preset configuration built on the mwx/ecs-fixers

dev-master 2026-08-27 10:09 UTC

This package is auto-updated.

Last update: 2026-08-27 19:12:27 UTC


README

The metaworx PHP coding standard as a distributable ECS preset, built on the custom fixers from mwx/ecs-fixers.

Contents

  • ecs.php — entry point (supports --reorder via the ECS_REORDER environment variable)
  • config/ecs/ — the preset: base rules, newline handling, control-structure braces, member reordering, and per-topic settings under config/ecs/settings/

Usage

config/ecs/base.php resolves paths from the consuming project's working directory (src/, tests/ and packages/ when present; fixture and spec case trees are skipped), and explicit paths on the ecs command line override them:

vendor/bin/ecs check --fix --config vendor/mwx/coding-standard/config/ecs/default.php [paths...]

The custom fixers are autoloaded through the consuming project's composer autoloader (mwx/ecs-fixers is a dependency of this package).

Install

Pre-publication: via the monorepo's path repository (see the repository root README). Later: composer require --dev mwx/coding-standard.

MIT license.