定制 chefsplate/sniffer-rules 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

chefsplate/sniffer-rules

Composer 安装命令:

composer require chefsplate/sniffer-rules

包简介

A Laravel 4 and Laravel 5 SquizLabs Code Sniffer 2.0 artisan command. Detect violations of a defined coding standard. It helps your code remains clean and consistent.

README 文档

README

Build Status Latest Stable Version License

This is a Laravel 4/5 package that hooks up SquizLabs CodeSniffer 2 into Laravel-based apps. It can also be used manually, so read on.

Detect violations of a defined coding standard. It helps your code remain clean and consistent. Available options are: PSR2, PSR1, Zend, PEAR, Squiz, PHPCS and ChefsPlate.

Setup

Require this package in composer:

$ composer require chefsplate/sniffer-rules

Laravel 4/5

In your config/app.php add ChefsPlate\SnifferRules\ServiceProvider:class to $providers array:

'providers' => [
    ...

    ChefsPlate\SnifferRules\ServiceProvider::class,

    ...
],

Laravel 5: Publish the configuration file

$ php artisan vendor:publish

Laravel 4: Manually create config

Copy config to app/config/sniffer-rules.php

Edit configuration file config/sniffer-rules.php to tweak the sniffer behavior.

Manual

Install our Standard by configuring PHP_CodeSniffer to look for it.

$ php ./vendor/bin/phpcs --config-set installed_paths ./vendor/chefsplate/src/ChefsPlate/SnifferRules/Standard/

Usage

Laravel

$ php artisan sniff

To run the sniffer in a CI environment, the -n option should be set to remove interaction:

$ php artisan sniff -n

Manual

$ php ./vendor/bin/phpcs --standard=ChefsPlate path/to/code

It's encouraged to add a Makefile to your project that makes it trivial for other developers. Use Makefile in this directory and adjust as needed to fit your project requirements.

ChefsPlate Coding Standards

Coding standards

Addendum and Clarifications

  • namespace should be on the same line as opening php tag. e.g.: <?php namespace ChefsPlate\Amazing
  • Property names should be snake_case
  • Test names should use underscores, not camelCase. e.g.: test_cats_love_catnip

License

MIT

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固