承接 eliashaeussler/php-cs-fixer-config 相关项目开发

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

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

eliashaeussler/php-cs-fixer-config

最新稳定版本:3.1.0

Composer 安装命令:

composer require eliashaeussler/php-cs-fixer-config

包简介

My personal configuration for PHP-CS-Fixer

README 文档

README

PHP-CS-Fixer config

Coverage CGL Tests Supported PHP Versions

This package contains basic PHP-CS-Fixer config for use in my personal projects. It is not meant to be used anywhere else. I won't provide support and don't accept pull requests for this repo.

🔥 Installation

Packagist Packagist Downloads

composer require eliashaeussler/php-cs-fixer-config

⚡ Usage

Configure PHP-CS-Fixer in your .php-cs-fixer.php file:

use EliasHaeussler\PhpCsFixerConfig;
use Symfony\Component\Finder;

// Create header rule
$header = PhpCsFixerConfig\Rules\Header::create(
    'eliashaeussler/package-name',
    PhpCsFixerConfig\Package\Type::ComposerPackage,
    PhpCsFixerConfig\Package\Author::create('Elias Häußler', 'elias@haeussler.dev'),
    PhpCsFixerConfig\Package\CopyrightRange::from(2021),
    PhpCsFixerConfig\Package\License::GPL3OrLater,
);

// Create TYPO3 rule set
$typo3RuleSet = PhpCsFixerConfig\Rules\Set\TYPO3RuleSet::create();

// Create custom rule set
$customRuleSet = PhpCsFixerConfig\Rules\RuleSet::fromArray([
    'modernize_types_casting' => true,
    'php_unit_test_case_static_method_calls' => [
        'call_type' => 'self',
    ],
]);

return PhpCsFixerConfig\Config::create()
    ->withRule($header)
    ->withRule($typo3RuleSet)
    ->withRule($customRuleSet)
    // You can also overwrite all rules
    ->withRule($customRuleSet, false)
    ->withFinder(static fn (Finder\Finder $finder) => $finder->in(__DIR__))
    // You can also inject your own Finder instance
    ->withFinder($finder)
;

⭐ License

This project is licensed under GNU General Public License 3.0 (or later).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2023-02-18