hereldar/coding-style

我项目的PHP编码风格规则。

0.1.3 2024-06-23 08:30 UTC

This package is auto-updated.

Last update: 2024-09-23 08:55:41 UTC


README

PHP Type Coverage Psalm Level Packagist License

Codely的编码风格启发的有意见的linting配置。

如何使用

通过Composer安装包

composer require --dev hereldar/coding-style

在项目的根目录下创建一个ecs.php文件

use Hereldar\CodingStyle;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return ECSConfig
    ::configure()
    ->withSets([
        CodingStyle::PROJECTS,
    ])
    ->withPaths([
        __DIR__.'/src',
        __DIR__.'/tests',
    ])
    ->withRootFiles();

执行以下命令以查看建议的更改

vendor/bin/ecs

要实际修复代码,添加--fix

vendor/bin/ecs --fix

有关更多信息,请参阅Easy Coding Standard文档

它做什么

使用以下方式检查项目的代码风格