enterio/coding-standard

Enterio 编码标准作为 PHPCS 规则集。

安装: 14

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

公开问题: 0

类型:phpcodesniffer-standard

dev-master 2018-12-13 13:07 UTC

This package is auto-updated.

Last update: 2024-09-14 03:20:48 UTC


README

Enterio 编码标准作为 PHPCS 规则集。

安装

使用以下命令安装编码标准

composer require "enterio/coding-standard"

要将此编码标准用于您的项目,请将以下 phpcs.xml 添加到根目录中

<?xml version="1.0"?>
<ruleset>
    <arg name="basepath" value="."/>
    <arg name="extensions" value="php"/>
    <arg name="parallel" value="80"/>
    <arg name="cache" value=".phpcs-cache"/>
    <arg name="colors"/>

    <!-- Ignore warnings, show progress of the run and show sniff names -->
    <arg value="nps"/>

    <!-- Directories to be checked -->
    <file>src</file>
    <file>tests</file>

    <!-- Include full Doctrine Coding Standard -->
    <rule ref="Enterio"/>
</ruleset>

用法

您可以使用 phpcs 检查违规

vendor/bin/phpcs --standard=Enterio /path/to/file/to/validate

您还可以使用 phpcbf 自动修复违规

vendor/bin/phpcbf --standard=Enterio /path/to/file/to/validate