Download the PHP package brandembassy/coding-standard without Composer
On this page you can find all versions of the php package brandembassy/coding-standard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download brandembassy/coding-standard
More information about brandembassy/coding-standard
Files in brandembassy/coding-standard
Package coding-standard
Short Description Brand Embassy Coding Standard
License proprietary
Informations about the package coding-standard
Brand Embassy Coding Standard
- The PHP_CodeSniffer and cs-fixer rules to check that repositories are following the unified coding standard for Brand Embassy projects.
- The PHPStan default configuration file.
- PhpStorm code style and inspections (with Php Inspections (EA Extended) plugin) configuration files.
Standards
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.
Installation
You can install the Brand Embassy Coding Standard as a composer dependency to your project:
ECS
You can run ecs with this command (without performing automatic fixes):
Or with automatic fixes:
You can use the --clear-cache
option to clear the cache before applying the fixers and sniffers:
PHPStan
- includes phpstan-strict-rules extension
- includes phpstan-nette extension
- includes max level configuration by default
To use default configuration include default-phpstan.neon in your project's PHPStan config:
Rector
To use default configuration require default-rector.php in your project's Rector config:
⚠️ Tests for Rector rules need to run in a separate process, because Rector and PHPStan use different versions of php-parser. See explanation here https://github.com/staabm/zf-select-strip/pull/8. Another way would be to run them in a separate testsuite, but then we run into problems with code-coverage.
PhpStorm
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.
Versioning
This library follows semantic versioning, and additions to the code ruleset are only performed in major releases.
Testing
@TODO: inspiration - https://github.com/doctrine/coding-standard/tree/master/tests
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:
All versions of coding-standard with dependencies
composer-runtime-api Version ^2.2
dealerdirect/phpcodesniffer-composer-installer Version ^0.5 || ^0.7 || ^1.0
phpstan/phpstan Version ^1.11.6
phpstan/phpstan-mockery Version ^1.1
phpstan/phpstan-nette Version ^1.3.0
phpstan/phpstan-phpunit Version ^1.4.0
phpstan/phpstan-strict-rules Version ^1.6.0
rector/rector Version ^1.2.0
slevomat/coding-standard Version ^8.15.0
squizlabs/php_codesniffer Version ^3.9.2
symplify/easy-coding-standard Version ^12.1.14
tomasvotruba/cognitive-complexity Version ^0.2.3