stickee/php-cs-fixer-config 问题修复 & 功能扩展

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

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

stickee/php-cs-fixer-config

Composer 安装命令:

composer require stickee/php-cs-fixer-config

包简介

stickee's PHP CS Fixer config

README 文档

README

Provides a PHP CS Fixer config for stickee projects.

Installation

composer require --dev stickee/php-cs-fixer-config
cp vendor/stickee/php-cs-fixer-config/dist/.php-cs-fixer.php .php-cs-fixer.php

You must commit the .php-cs-fixer.php config file.

You must add .php-cs-fixer.cache to your .gitignore file.

Usage

vendor/bin/php-cs-fixer fix

Overrides

You can override any of the rules or add your own by adding them to the $overrideRules array in the .php-cs-fixer.php file.

See here for a detailed description of available rules and their options.

Example

This has already been done for you with the ordered_class_elements rule which has been reset to the PSR12 value of use_traits only.

This has been added to help PR reviewers see only what has been changed when linting your project and not elements that have been re-ordered.

Once you are happy that your project has been linted correctly you may remove this override to use the stickee settings for this rule which are stricter and order more elements.

CI

An example GitHub action file is included at vendor/stickee/php-cs-fixer-config/dist/.github/workflows/php-cs-fixer.yaml.

This will run PHP CS Fixer on PRs and new commits to those PRs.

Rules

The available RuleSets can be found at vendor/stickee/php-cs-fixer-config/src/RuleSet/.

You can probably [ctrl] + click the class in the .php-cs-fixer.php file to get to it in your editor.

Web description (prettier)

You can use either https://mlocati.github.io/php-cs-fixer-configurator/#version:3.2 or https://cs.symfony.com/doc/rules/index.html to see what the rules are doing.

CLI description (faster)

Alternatively you can run vendor/bin/php-cs-fixer describe <rule-or-set-name>.

Credits

https://github.com/Visual-Craft/php-cs-fixer-config

for inspiration on how to create a custom config for PHP CS Fixer since there's no built-in way to do it.

stickeerehan

for his earlier work on PHP Code Styles so I didn't have to start from scratch.

The "supermarket mobiles" developers

for reviewing the many PRs that finalised the rules that we use.

The members of the #codestyle Slack channel

for caring about code styles.

stickee/php-cs-fixer-config 适用场景与选型建议

stickee/php-cs-fixer-config 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16.61k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2022 年 11 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 stickee/php-cs-fixer-config 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-08