wpsh/wpcs-for-envato
Composer 安装命令:
composer require wpsh/wpcs-for-envato
包简介
WordPress coding standards for Envato plugins and themes
README 文档
README
Automatically check for Envato WordPress plugin and theme coding requirements. Based on the official WordPress coding standards but more relaxed.
Requirements
Setup
-
Add these coding standards as a Composer development dependency to your project:
composer require --dev wpsh/wpcs-for-envato
-
Define a script in
composer.jsonto run the checks:{ "scripts": { "phpcs": "./vendor/bin/phpcs --standard=WPCSForEnvato --extensions=php", "phpcs-fix": "./vendor/bin/phpcbf --standard=WPCSForEnvato --extensions=php" } }Use
composer phpcsto run the coding standard checks andcomposer phpcs-fixto automatically fix some of the coding standard violations.
Configuration
Add phpcs.xml.dist to your project root that provides additional configuration options:
<?xml version="1.0"?> <ruleset name="WordPress coding standards for Envato"> <rule ref="WPCSForEnvato"/> <!-- Specify a prefix that should be used for all global functions and variables. --> <rule ref="WordPress.NamingConventions.PrefixAllGlobals"> <properties> <property name="prefixes" type="array"> <element value="our_custom_prefix"/> <element value="tgmpa"/> </property> </properties> </rule> </ruleset>
Credits
Created by Kaspars Dambis.
统计信息
- 总下载量: 82
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-10