承接 fossbarrow/laravel-phpcs 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

fossbarrow/laravel-phpcs

Composer 安装命令:

composer require fossbarrow/laravel-phpcs

包简介

phpcs ruleset for laravel projects

README 文档

README

MIT Licensed PR friendly repository Follow Fossbarrow on Twitter

Authored by fossbarrow IO

php codesniffer ruleset for laravel projects.

Requirements

Table of contents

Installation

Install the ruleset by

  1. Copy the phpcs.xml file into your project root with phpcs installed.

Usage

Enabling the rules

Only neccesary if you installed as a package using composer!

Add it to your project phpcs.xml or phpcs.xml.dist ruleset:

<?xml version="1.0"?>
<ruleset>
    <arg name="basepath" value="."/>

    <file>./app</file>
    <file>./config</file>
    <file>./resources</file>
    <file>./routes</file>
    <file>./tests</file>

    <rule ref="./vendor/fossbarrow/laravel-phpcs/phpcs.xml"/>
</ruleset>

Sniffing code

Use php CodeSniffer commands, pointed towards your xml file, to sniff the code using the new ruleset.

vendor/bin/phpcs vendor/bin/phpcbf

Sniffing code in PHPStorm

See PHP Code Sniffer in PhpStorm on how to set up CodeSniffer in PHPStorm.

Contributing

All changes that makes the sniffer more accurate towards Laravel's coding standard is always highly appreciated and welcome.

Please see CONTRIBUTING for more details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 286.75k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 40
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 40
  • Watchers: 2
  • Forks: 24
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-06-17