dbt/php-cs-fixer-config 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

dbt/php-cs-fixer-config

Composer 安装命令:

composer require dbt/php-cs-fixer-config

包简介

De Boer Tool PHP-CS-Fixer Configuration

README 文档

README

Installation

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

If you don't already have a .php_cs.dist.php configuration file, create one in your project root:

touch .php_cs.dist.php

Then fill it out:

<?php

use Dbt\PhpCsFixerConfig\Loader;
use PhpCsFixer\Finder;

$finder = Finder::create()->in([
    __DIR__ . '/src',
    // Add your own directories here.
]);

// If you want to add your own rules. If you specify a rule that already exists
// in the base ruleset, your local rule will take precedence and override the
// base rule.
$localRules = require(__DIR __ . '/rules.php');

$loader = Loader::new($finder, $localRules);

// If you want to turn off risky tests.
$loader->disallowRisky();

return $loader->getConfig();

Composer Scripts

You can optionally add Composer scripts to your composer.json so you don't have to run PHP-CS-Fixer from your vendor directory each time. For example:

{
  "scripts": {
    "cs": "php-cs-fixer fix",
    "cs-dry": "php-cs-fixer fix --dry-run"
  }
}

PHPStorm

https://www.jetbrains.com/help/phpstorm/using-php-cs-fixer.html

GrumPHP

If you wish to use GrumPHP to ensure code checks run pre-commit, you can do something like the following:

Install GrumPHP:

composer require --dev phpro/grumphp

Add a configuration file:

touch grumphp.yml

Fill it out, for example:

parameters:
    ascii: ~
    tasks:
        phpcsfixer2:
            config: '.php_cs.dist.php'

License

MIT. Do as you wish.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固