承接 phpcsstandards/phpcsdevcs 相关项目开发

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

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

phpcsstandards/phpcsdevcs

Composer 安装命令:

composer require --dev phpcsstandards/phpcsdevcs

包简介

Coding Standards ruleset for the code in external standards for PHP_CodeSniffer.

README 文档

README

Latest Stable Version Release Date of the Latest Version 🚧 Latest Unstable Version Build Status Last Commit to Unstable

Minimum PHP Version License: LGPLv3 Awesome

This is an external ruleset for PHP CodeSniffer intended for use by sniff developers.

Installation

Composer Project-based Installation

Run the following from the root of your project:

composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer require --dev phpcsstandards/phpcsdevcs:"^1.0"

Composer Global Installation

If you work on several different sniff repos, you may want to install this toolset globally:

composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer global require --dev phpcsstandards/phpcsdevcs:"^1.0"

Composer will automatically install dependencies and register the PHPCSDev and other external standards with PHP_CodeSniffer using the Composer PHPCS plugin.

PHPCSDev ruleset for sniff repos

Once this project is installed, you will see a new PHPCSDev ruleset in the list of installed standards when you run phpcs -i.

Important: This ruleset currently requires PHP_CodeSniffer >= 3.13.0+.

As sniffs developers will mostly work with the latest version of PHP_CodeSniffer, this shouldn't cause any problems.

Similarly, the CS check in automated CI runs should normally be run on a high PHPCS version for the best results.

The PHPCSDev standard can be used by sniff developers to check the code style of their sniff repo code.

Often, sniff repos will use the code style of the standard they are adding. However, not all sniff repos are actually about code style.

So for those repos which need a basic standard which will still keep their code-base consistent, this standard should be useful.

The standard checks your code against the following:

  • Compliance with PSR-12, with a few exceptions.
  • Use of camelCase variable and function names.
  • Use of normalized arrays.
  • All files, classes, functions and properties are documented with a docblock and contain the minimally needed information.
  • A number of arbitrary additional code style and QA checks.
  • PHP cross-version compatibility, while allowing for the tokens back-filled by PHPCS itself. Note: for optimal results, the project custom ruleset should set the testVersion config variable. This is not done by default as config variables are currently difficult to overrule.

The ruleset can be used like any other ruleset and specific sniffs and settings can be added to or overruled from a custom project based ruleset.

Using the ruleset from the command line

phpcs . --standard=PHPCSDev

Using the ruleset from within a project based ruleset

Add the following line to your project's phpcs.xml.dist file:

<rule ref="PHPCSDev"/>

Contributing

Contributions to this project are welcome. Just clone the repo, branch off from main, make your changes, commit them and send in a pull request.

If unsure whether the changes you are proposing would be welcome, open an issue first to discuss your proposal.

License

This code is released under the GNU Lesser General Public License (LGPLv3). For more information, visit http://www.gnu.org/copyleft/lesser.html

phpcsstandards/phpcsdevcs 适用场景与选型建议

phpcsstandards/phpcsdevcs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 726.84k 次下载、GitHub Stars 达 9, 最近一次更新时间为 2020 年 02 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「static analysis」 「phpcs」 「PHP_CodeSniffer」 「phpcodesniffer-standard」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 phpcsstandards/phpcsdevcs 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 9
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2020-02-12