comlaude/php-formatter 问题修复 & 功能扩展

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

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

comlaude/php-formatter

最新稳定版本:1.0.4

Composer 安装命令:

composer require comlaude/php-formatter

包简介

Pre-configured php formatter

README 文档

README

Pre-configured php formatter using php-cs-fixer

Latest Stable Version License

Installation

Composer

Add the following to your require part within the composer.json:

"comlaude/php-formatter": "^1.0.0"
$ php composer update

or

$ php composer require comlaude/php-formatter

Integration

Lumen

Create a config folder in the root directory of your Lumen application and copy the content from vendor/comlaude/php-formatter/config/php-formatter.php to config/php-formatter.php.

Adjust the properties to your needs.

return [
    // A flag to enable/disable caching mode
    'cache' => false,
    // See https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/3.0/doc/rules/index.rst for available rules and rulesets
    'rules' => [
        '@PSR2' => true,
        '@DoctrineAnnotation' => true,
        'whitespace_after_comma_in_array' => true,
    ],
    // You can initialises your own ParallelConfig class here with your desired parameters
    // default is set to detect the environment and use the appropriate resources
    'parallel' => PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect(),
    // this is used to call function on configuring a finder as defined here https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/3.0/doc/config.rst
    'finder' => [
        'include'  => [],
        'exclude'  => ['bootstrap', 'vendor', 'storage'],
        'name'     => ['*.php'],
        'notname'  => ['*.blade.php'],
        'in'       => __DIR__ . '/../../../../',
    ];

Basic Usage

php vendor/bin/php-formatter fix

CI Automation usage

php vendor/bin/php-formatter fix -v --dry-run

License

This package is open-sourced software licensed under the MIT license

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-05-13