wordpress composer
Composer
{
"name": "qiyu/wordpress",
"description": "Left Code Right Poem",
"keywords": ["wordpress", "plugin", "private"],
"homepage": "https://blog.csdn.net/qq_36830044",
"license": "proprietary",
"authors": [
{
"name": "qiyu",
"email": "*********@gmail.com",
"homepage": "https://www.wpzhiku.com/"
}
],
"type": "wordpress-plugin",
"require": {
"php": ">=7.4.19"
}
}
composer install
composer require “” 引入第三方包
PHP_CodeSniffer
PHP_CodeSniffer是两个PHP脚本的集合; 主要的phpcs脚本可对PHP,JavaScript和CSS文件进行标记化,以检测是否违反了已定义的编码标准,而第二个phpcbf脚本可自动更正违反的编码标准。 PHP_CodeSniffer是必不可少的开发工具,可确保您的代码保持干净和一致。
composer链接
composer require "squizlabs/php_codesniffer=3.*"
PHPCS
vendor/bin/phpcs wp-content/plugins/customize/wc-customize.php
一般出现的可能错误
- 添加文件级文档注释。
- 在对行文件中的函数的调用中,在逗号后添加空格。
- 在脚本中的if语句之后添加空格。
|