Brand Embassy Coding Standard

Installs: 146 200

Dependents: 16

Suggesters: 0

Security: 0

Stars: 2

Watchers: 10

Forks: 0

Open Issues: 8




For full reference of enforcements, go through default-ecs.php where each sniff / fixer deviating from default set lists is briefly described.

@TODO list of important sniffs

Skippable sniffs / fixers

Skipping of sniffs / fixers in general or for particular files should be configured in the ecs.php of your project. This file should leverage the default-ecs.php as the default configuration, but it expected that you will make adjustments to fit your project needs.


You can install the Brand Embassy Coding Standard as a composer dependency to your project:

$ composer require --dev brandembassy/coding-standard


You can run ecs with this command (without performing automatic fixes):

$ ./vendor/bin/ecs check --ansi

Or with automatic fixes:

$ ./vendor/bin/ecs check --ansi --fix

You can use the --clear-cache option to clear the cache before applying the fixers and sniffers:

$ ./vendor/bin/ecs check --ansi --fix --clear-cache


To use default configuration include default-phpstan.neon in your project's PHPStan config:

    - vendor/brandembassy/coding-standard/integration-phpstan.neon


This project contains inspections and code style configurations for PhpStorm.

  • BrandEmbassyCodeStyle.xml
  • BrandEmbassyInspections.xml

Importing these configurations reduces number of errors in phpcs check before committing.


This library follows semantic versioning, and additions to the code ruleset are only performed in major releases.


@TODO: inspiration -

If you are contributing to the Brand Embassy Coding Standard and want to test your contribution, you just need to execute PHPCS with the tests folder and ensure it matches the expected report:

$ ./vendor/bin/phpcs tests/input --report=summary --report-file=phpcs.log; diff tests/expected_report.txt phpcs.log