yutahaga/wpcs-psr2 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

yutahaga/wpcs-psr2

Composer 安装命令:

composer require yutahaga/wpcs-psr2

包简介

PHP_CodeSniffer ruleset to enforce WordPress & PSR-2 coding conventions

README 文档

README

PHP_CodeSniffer ruleset to enforce WordPress & PSR-2 coding conventions

Introduction

A rule set that combines WordPress Coding Standards and PSR-2. The goal is to reduce the stress on developers by reducing the differences in coding conventions with other PHP applications.

Installation

Automatic install

Add the following scripts in composer.json

{
  "scripts": {
    "install-codestandards": ["Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"],
    "post-install-cmd": ["@install-codestandards"]
  }
}
composer require --dev dealerdirect/phpcodesniffer-composer-installer
composer require --dev yutahaga/wpcs-psr2

Manually install

composer require --dev yutahaga/wpcs-psr2
phpcs --config-set installed_paths ./vendor/yutahaga/wpcs-psr2,./vendor/wp-coding-standards/wpcs,other-ruleset

Usage

Here is an example of the phpcs.xml

<?xml version="1.0"?>
<ruleset name="My Coding Standards">
  <description>My Coding Standards extends WordPress-Extra and PSR-2</description>

  <rule ref="WordPress-PSR2" />

  <file>./app</file>
  <file>./bootstrap</file>
  <file>./config</file>
  <file>./functions.php</file>

  <exclude-pattern>bootstrap/cache/*.php</exclude-pattern>
  <exclude-pattern>*/*.js</exclude-pattern>
  <exclude-pattern>*/*.css</exclude-pattern>
  <exclude-pattern>*/*.xml</exclude-pattern>
  <exclude-pattern>*/node_modules/*</exclude-pattern>
  <exclude-pattern>*/vendor/*</exclude-pattern>
</ruleset>

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固