bombenprodukt/php-cs-fixer-config

为 friendsofphp/php-cs-fixer 提供配置工厂和多个规则集。


README

该项目由 Brian Faust 创建并维护,是一个提供配置工厂和多个预设的 friendsofphp/php-cs-fixer 包。请务必浏览 变更日志行为准则贡献指南许可安全策略

安装

注意 此包需要 PHP 8.2 或更高版本,并且支持 Laravel 10 或更高版本。

要获取最新版本,请使用 Composer 需求此项目。

$ composer require bombenprodukt/php-cs-fixer-config

用法

// .php-cs-fixer.php
<?php

use BombenProdukt\PhpCsFixer\ConfigurationFactory;
use BombenProdukt\PhpCsFixer\Preset\Standard;

$header = <<<EOF
Copyright (c) 2023 BombenProdukt

For the full copyright and license information, please view
the LICENSE file that was distributed with this source code.
EOF;

$config = ConfigurationFactory::fromPreset(new Standard($header));
$config->getFinder()->in(__DIR__);

return $config;