brandembassy/coding-standard 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

brandembassy/coding-standard

最新稳定版本:14.3

Composer 安装命令:

composer require brandembassy/coding-standard

包简介

Brand Embassy Coding Standard

README 文档

README

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:

$ composer require --dev brandembassy/coding-standard

ECS

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

PHPStan

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

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

Rector

To use default configuration require default-rector.php in your project's Rector config:

$rectorConfigBuilder = RectorConfig::configure();
$defaultRectorConfigurationSetup = require __DIR__ . '/vendor/brandembassy/coding-standard/default-rector.php';

$defaultSkipList = $defaultRectorConfigurationSetup($rectorConfigBuilder);

// You can skip unwanted rules here
$skipList = array_merge(
    $defaultSkipList,
    [
        '*/__fixtures__/*',
        NewlineAfterStatementRector::class, // might conflict with ECS
    ],
);

// You can override/append to the default configuration here
$rectorConfigBuilder
    ->withPHPStanConfigs([__DIR__ . '/phpstan.neon'])
    ->withCache('./var/temp/rector', FileCacheStorage::class)
    ->withSkip($skipList);

return $rectorConfigBuilder;

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:

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

brandembassy/coding-standard 适用场景与选型建议

brandembassy/coding-standard 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 379.91k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 brandembassy/coding-standard 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 brandembassy/coding-standard 我们能提供哪些服务?
定制开发 / 二次开发

基于 brandembassy/coding-standard 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 379.91k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 9
  • 依赖项目数: 16
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 10
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-01-04