此包最新版本(dev-main)没有可用的许可证信息。

Craft CMS 项目的Easy Coding Standard配置

dev-main 2022-06-24 15:28 UTC

This package is auto-updated.

Last update: 2024-08-24 20:41:53 UTC


README

https://github.com/craftcms/ecs 分支修改而来

  • 启用 parallel 模式运行。
  • 将控制结构续行关键字设置为下一行。
// Before:

if ($condition) {
    // Do things
} else {
    // Do other things
}


// After:

if ($condition) {
    // Do things
} 
else {
    // Do other things
}

要安装,请在您的插件或项目中运行以下命令

composer require putyourlightson/ecs:dev-main --dev

然后在您的插件或项目根目录中添加一个 ecs.php 文件

<?php

declare(strict_types=1);

use putyourlightson\ecs\SetList;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return static function(ECSConfig $ecsConfig): void {
    $ecsConfig->paths([
        __DIR__ . '/src',
        __FILE__,
    ]);
    
    $ecsConfig->sets([SetList::CRAFT_CMS_3]); // for Craft 3 projects
    $ecsConfig->sets([SetList::CRAFT_CMS_4]); // for Craft 4 projects
};

PutYourLightsOn 创建。