mobizel / coding-standard
在Mobizel使用的经过实战检验的编码标准配置。
v1.3.0
2022-06-03 14:18 UTC
Requires
- php: ^8.0
- symplify/easy-coding-standard: ^10.0
This package is auto-updated.
Last update: 2024-08-30 01:10:00 UTC
README
编码标准
🥇 在Mobizel使用的经过实战检验的编码标准配置。
安装与使用
-
安装此包
$ composer require --dev mobizel/coding-standard
-
将配置文件导入你的
ecs.php
$ecsConfig->import('vendor/mobizel/coding-standard/ecs.php');
示例配置(ecs.php)
<?php use PhpCsFixer\Fixer\Comment\HeaderCommentFixer; use Symplify\EasyCodingStandard\Config\ECSConfig; return static function (ECSConfig $ecsConfig): void { $ecsConfig->import('vendor/mobizel/coding-standard/ecs.php'); $header = <<<EOM This file is part of <The Project>. (c) Mobizel For the full copyright and license information, please view the LICENSE file that was distributed with this source code. EOM; $services = $ecsConfig->services(); $services ->set(HeaderCommentFixer::class) ->call('configure', [[ 'header' => $header, 'location' => 'after_open', ]]) ; };