fws/php-coding-standards

FWS的内部PHP编码标准

安装次数: 19

依赖项: 0

建议者: 0

安全: 0

星级: 0

关注者: 1

分支: 0

开放问题: 0

类型:phpcodesniffer-standard

1.0.1 2021-03-01 15:40 UTC

This package is auto-updated.

Last update: 2024-09-29 05:36:38 UTC


README

安装

要在项目中安装,使用以下命令

composer require fws/php-coding-standards --dev

然后,将一个phpcs.xml文件添加到您的项目中

<?xml version="1.0"?>
<ruleset name="Project">
    <rule ref="FWS"/>
</ruleset>

为了快速完成,运行以下命令

echo '<?xml version="1.0"?><ruleset name="Project"><rule ref="FWS"/></ruleset>' > phpcs.xml

安装将自动安装Forwardslash标准到vendor/bin/phpcs

CLI Linting

检查单个文件

./vendor/bin/phpcs -s path/to/file.php

检查多个文件

./vendor/bin/phpcs -s --extensions=php /path/to/dir

编辑器Linting

在您喜欢的编辑器中安装它的phpcs插件,它将自动检测您的phpcs.xml文件并对您打开的任何PHP文件进行lint检查。