prezly/code-style 问题修复 & 功能扩展

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

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

prezly/code-style

最新稳定版本:v6.0.0

Composer 安装命令:

composer require prezly/code-style

包简介

Prezly Code style configurations

README 文档

README

PHP Code Style checker (and fixer) is built with Easy-Coding-Standard.

Usage

  1. (Optional) Add prefixed ECS CLI tool into your composer requirements (if you're not a fan of resolving conflicts with enormous dependencies list of simplify/easy-coding-standard).

    composer require --dev symplify/easy-coding-standard-prefixed
  2. Link prezly/code-style repo as composer dependency

    composer require prezly/code-style:~4.0
  3. Include the provided configuration into your project.

    Simply create an ecs.php file in your project root and include the ecs.php provided by this package into it.

    <?php
     
    // Include the stock prezly/code-style config as is.
    return require __DIR__ . '/vendor/prezly/code-style/ecs.php';
  4. If you need to extend or override the stock configuration, you can of course do it by adding code on top of it:

    <?php
    
    declare(strict_types=1);
    
    use PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer;
    use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
    
    return static function (ContainerConfigurator $config): void {
        // Include the stock prezly/code-style config.
        (require __DIR__ . '/vendor/prezly/code-style/ecs.php')($config);
    
        $services = $config->services();
    
        // Override stock preset configuration.
        $services->set(BinaryOperatorSpacesFixer::class)->call('configure', [
            [
                'operators' => [
                    '=>' => 'align',
                ],
            ],
        ]);
    };
  5. Run checks (you can also configure your CI to run this for you on every push):

    vendor/bin/ecs check src/
  6. Fix problems:

    vendor/bin/ecs check src/ --fix

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 3
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-23