onramplab / onr-phpcs-laravel
Laravel 的 PHPCS 库和配置
v1.2.0
2022-09-28 08:38 UTC
Requires
README
我们使用这个包在我的 Laravel 项目中设置一致的 PHPCS 配置。规则集基于 @emielmolenaar 规则集。
如果你希望在你的项目中使用此配置,请使用 composer 安装
composer require --dev onramplab/onr-phpcs-laravel
之后,运行 php vendor/bin/phpcs -i
以验证 onr-phpcs-laravel
是否被列为已安装的规则集。
你现在可以使用规则集如下
php vendor/bin/phpcs --standard=onr-phpcs-laravel app/
或者你可以在根目录中创建一个 phpcs.xml
文件,使用以下示例
<?xml version="1.0"?> <ruleset name="Onramplab Laravel Standards"> <description>The Laravel Coding Standards</description> <rule ref="onr-phpcs-laravel"/> <file>app</file> <file>config</file> <file>public</file> <file>resources</file> <file>routes</file> <file>tests</file> </ruleset>
欢迎贡献。