flexis/php-cs-fixer-config

为 friendsofphp/php-cs-fixer 提供常用配置,在 FLEX-IS 中使用

v0.1.1 2023-04-09 20:35 UTC

This package is auto-updated.

Last update: 2024-09-17 11:50:25 UTC


README

Version Build Coverage License: MIT

此仓库创建的目的是为了在 FLEX-IS 中引入统一的 PHP 代码编码标准。

它基于 refinery29/php-cs-fixer-config 的想法。

安装

通过 composer 安装此包

$ composer require --dev flexis/php-cs-fixer-config

创建配置文件 .php-cs-fixer.dist.php

  1. 创建 Finder 并指定源代码的路径。
  2. 根据目标 PHP 版本选择一组规则。
  3. (可选) 设置头部注释。
  4. 设置缓存文件名并将其添加到 .gitignore
    • .php-cs-fixer.cache

使用方法

要手动修复编码标准,运行

$ php vendor/bin/php-cs-fixer fix

💡 更多示例请参阅 官方文档

许可证

此包使用 MIT 许可证进行许可。