承接 efabrica/coding-standard 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

efabrica/coding-standard

Composer 安装命令:

composer require efabrica/coding-standard

包简介

PSR2 based coding standard for PHP PHP_CodeSniffer

README 文档

README

eFabrica coding standards for PHP_CodeSniffer are based on PSR2.

eFabrica coding standard

Is based on PSR2 and adds some rules:

  1. Allows max. 1 empty line between code lines
  2. Doesn't allow any whitespace at the end of lines
  3. Doesn't allow any whitespace between closing parenthesis and return type colon
  4. Requires exactly one space between type and variable
  5. Requires exactly one space between return type colon and return type
  6. Requires exactly one space before and after each operator
  7. Requires exactly one space before and after . (dot) in string concatenating
  8. Requires exactly one space after keywords private, protected, public, abstract, final
  9. Requires exactly one blank line before and one blank line after namespace statement
  10. Requires max. one namespace per file
  11. Doesn't allow any blank lines between uses and trait uses
  12. Requires one line before first use and one line after last use (not applied if it is trait use and it is first / last in class)
  13. Requires exactly one blank line before and after each function except first and last
  14. Requires exactly one blank line before and after each member var except first and last
  15. Requires new with parentheses.
  16. Prefer to use single quotes over double quotes. Double quotes are allowed if string contains variable
  17. Requires trailing comma after the last element of multi-line array
  18. Requires all class names as reference (no fully qualified or partial names - everything is in uses)
  19. Requires all uses to be used
  20. Requires alphabetically sorted uses
  21. Disallows leading backslash for uses
  22. Disallows snake_case for properties, variables, function names, method names
  23. Doesn't allow underscore in method names
  24. Doesn't allow multiple spaces between type and property / variable / parameter
  25. Class structure is defined as follows: uses, enum cases, constants, properties, constructor, methods
  26. Requires visibility for all constants
  27. Requires exactly one blank line between methods
  28. Doesn't allow any useless comments

Usage

composer require efabrica/coding-standard --dev
vendor/bin/phpcs {dirs} --standard="vendor/efabrica/coding-standard/eFabrica" {other-options}

for {dirs} use space-separated list of directories
for {other-options} see vendor/bin/phpcs --help or visit PHP_CodeSniffer documentation

eFabricaDeclareStrictAndUse

Is based on eFabrica coding standard and adds some rules:

  1. Use declare(strict_types=1); at the top of each PHP file. Use one empty line before and also after declare
  2. Requires all names (classes, functions, constants) as reference (no fully qualified or partial names - everything is in uses)

Usage

composer require efabrica/coding-standard --dev
vendor/bin/phpcs {dirs} --standard="vendor/efabrica/coding-standard/eFabricaDeclareStrictAndUse" {other-options}

for {dirs} use space-separated list of directories
for {other-options} see vendor/bin/phpcs --help or visit PHP_CodeSniffer documentation

eFabricaStrict coding standard

Is based on eFabricaDeclareStrictAndUse coding standard and adds some strict rules:

  1. Requires each class to be declared either as abstract or as final

Usage

composer require efabrica/coding-standard --dev
vendor/bin/phpcs {dirs} --standard="vendor/efabrica/coding-standard/eFabricaStrict" {other-options}

for {dirs} use space-separated list of directories
for {other-options} see vendor/bin/phpcs --help or visit PHP_CodeSniffer documentation

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

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 181.93k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 24
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-07-30