umbrellio/code-style-php

Umbrellio php代码风格。

2.0 2024-05-02 17:05 UTC

This package is auto-updated.

Last update: 2024-09-02 17:49:33 UTC


README

用于Umbrellio php项目的设置。

安装

通过composer安装

php composer.phar require --dev umbrellio/code-style-php

创建配置文件ecs.yml

imports:
  - { resource: vendor/umbrellio/code-style-php/umbrellio-cs.yml }

如果EasyCodingStandard的主版本为9或更高,则创建配置文件ecs.php

<?php

declare(strict_types=1);

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function(ContainerConfigurator $containerConfigurator): void {
    $containerConfigurator->import(__DIR__ . '/vendor/umbrellio/code-style-php/umbrellio-cs.php');
};

使用方法

在命令行中运行

vendor/bin/ecs check src --fix --config=ecs.yml

vendor/bin/ecs check src --fix --config=ecs.php

依赖关系(和链接)

许可证

在MIT许可证下发布。

贡献

  • 分叉它( https://github.com/umbrellio/code-style-php
  • 创建你的功能分支(git checkout -b feature/my-new-feature
  • 提交你的更改(git commit -am 'Add some feature'
  • 推送到分支(git push origin feature/my-new-feature
  • 创建新的Pull Request
Supported by Umbrellio