dxw/php-cs-fixer-config

v2.1.1 2023-09-13 12:53 UTC

This package is auto-updated.

Last update: 2024-09-13 14:51:43 UTC


README

dxw为php-cs-fixer提供的标准配置

用法

执行以下命令

composer require --dev dxw/php-cs-fixer-config

创建包含以下内容的 .php-cs-fixer.php

<?php

$finder = \PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__);

return \Dxw\PhpCsFixerConfig\Config::create()
->setFinder($finder);

从v1.0.0升级到v2.0.0

  • 将项目中的 .php_cs 文件重命名为 .php-cs-fixer.php
  • .php-cs-fixer.cache 添加到项目中的 .gitignore 文件
  • 运行 vendor/bin/php-cs-fixer fix -v 以确认唯一剩余的弃用警告是 "PhpCsFixer\Config::create 是自 2.17 弃用的,将在 3.0 中移除,请使用构造函数代替"。如果有其他弃用警告,现在处理它们。
  • 更新项目的 composer.json 文件,使用 dxw/php-cs-fixer-config 版本 ^2.0,并运行 composer update