定制 egeniq/php-coding-standard 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

egeniq/php-coding-standard

最新稳定版本:1.2.0

Composer 安装命令:

composer require egeniq/php-coding-standard

包简介

The Egeniq Coding Standard is a set of PHPCS rules that we use at Egeniq, it's based on the Doctrine project.

README 文档

README

The Egeniq Coding Standard is a set of PHP_CodeSniffer rules that we use at Egeniq. The standard is heavily based on Doctrine Coding Standard.

Installation

You can install the Egeniq coding standard as a composer dependency to your particular project. Just run the following command to add it to your project:

php composer require --dev egeniq/php-coding-standard

Then you can use it like:

vendor/bin/phpcs --standard=Egeniq /path/to/some/file/to/sniff.php

You might also do automatic fixes using phpcbf:

vendor/bin/phpcbf --standard=Egeniq /path/to/some/file/to/sniff.php

Project-level ruleset

To enable the Egeniq coding standard for your project, create a phpcs.xml.dist file with the following content:

<?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>app</file>
    <file>tests</file>

    <!-- Include full Egeniq coding standard -->
    <rule ref="Egeniq">
        <!-- sniffs to exclude -->
        <!-- by default strict types are required, but if you wish to disable this, exclude the following sniff:
        <exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"/>
        -->
    </rule>
</ruleset>

This will enable verbatim the Egeniq coding standard with all rules included with their defaults. From now on you can just run vendor/bin/phpcs and vendor/bin/phpcbf without any arguments 🙌.

统计信息

  • 总下载量: 14.41k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 8
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固