figlab/coding-standard

适用于Laravel应用的PHPCS编码规范。

安装: 127

依赖项: 0

建议者: 0

安全: 0

星标: 1

关注者: 2

分支: 0

开放问题: 0

类型:phpcodesniffer-standard

1.0.4 2024-08-06 01:40 UTC

This package is auto-updated.

Last update: 2024-09-06 05:45:31 UTC


README

为Laravel应用和包提供的PHPCS编码规范。基于出色的IxDF编码规范

安装

  1. 通过运行以下命令通过composer安装包:
composer require --dev figlab/coding-standard
  1. 将composer脚本添加到你的composer.json文件中
"scripts": {
  "cs:check": "phpcs -p -s --colors --report-full --report-summary",
  "cs:fix": "phpcbf -p --colors"
}
  1. 在你的仓库基本路径上创建名为phpcs.xml的文件,内容如下
<?xml version="1.0"?>
<ruleset name="My Coding Standard">
    <!-- Include all rules from the IxDF Coding Standard -->
    <rule ref="FigLabCodingStandard"/>

    <!-- Paths to check -->
    <file>app</file>
    <file>config</file>
    <file>database</file>
    <file>lang</file>
    <file>routes</file>
    <file>tests</file>
</ruleset>

用法

  • 仅运行检查
composer cs:check
  • 自动修复CS问题
composer cs:fix