定制 sylarele/php-cs-fixer-config 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

sylarele/php-cs-fixer-config

最新稳定版本:v2.0.0

Composer 安装命令:

composer require sylarele/php-cs-fixer-config

包简介

Our internal PHP CS Fixer config

README 文档

README

License Packagist Dependency Version Packagist Downloads

Configuration for https://github.com/FriendsOfPhp/PHP-CS-Fixer

Installation

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

Usage

Configuration

Create a configuration file .php-cs-fixer.php in the root of your project:

<?php

declare(strict_types=1);

use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfig;
use Sylarele\PhpCsFixerConfig\Config;

$finder = Finder::create()
    ->exclude('storage')
    ->in(__DIR__)
    ->append([
        __FILE__,
    ]);

$config = new Config();

return $config
    ->setCacheFile(__DIR__.'/storage/tmp/php-cs-fixer/.php-cs-fixer.cache')
    ->setFinder($finder)
    ->setUsingCache(true)
    ->setParallelConfig(new ParallelConfig(6, 80));

Custom configuration

You may extend these rules and apply your own extra rules.

Create a configuration file .php-cs-fixer.php in the root of your project:

<?php

declare(strict_types=1);

use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfig;

$finder = Finder::create()
    ->exclude('storage')
    ->in(__DIR__)
    ->append([
        __FILE__,
    ]);

$config = new class() extends PhpCsFixer\Config {
    public function __construct()
    {
        parent::__construct('Customized Sylarele');
        
        $this->setRiskyAllowed(true);
    }
    
    public function getRules(): array
    {
        $rules = (new Sylarele\PhpCsFixerConfig\Config())->getRules();
        
        // Update the rules table here
        
        return $rules;
    }
};

$config->setFinder($finder);

return $config;

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固