eve/coding-standard

基于 slevomat/coding-standard 的 eve 编码规范

v1.1.0 2021-04-12 11:46 UTC

This package is auto-updated.

Last update: 2024-09-12 21:08:29 UTC


README

PHP CodeSniffer 定制的 eve 编码规范,基于 slevomat/coding-standard 构建。适用于基于 Laravel 的项目。

安装

使用 Composer 安装包

composer require --dev eve/coding-standard

使用方法

  1. 在你的 ruleset.xml 中,添加一个引用包中规则集的规则

    <?xml version="1.0"?>
    <ruleset name="My Awesome Standards">
        <rule ref="./vendor/eve/coding-standard/ruleset.xml"/>
    
        <!-- add extra configurations if necessary -->
        <file>./app</file>
        <file>./bootstrap</file>
        <file>./config</file>
        <file>./database</file>
        <file>./routes</file>
        <file>./tests</file>
    </ruleset>
  2. 使用它!

    # check for violations
    composer phpcs --standard=ruleset.xml
    
    # fix the violations if applicable
    composer phpcbf --standard=ruleset.xml 

许可协议

当然是 MIT 协议。