2017 © Pedro Peláez
 

library 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.

image

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.

  • Wednesday, July 5, 2017
  • by bmanza87
  • Repository
  • 3 Watchers
  • 2 Stars
  • 818 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 5 Open issues
  • 2 Versions
  • 29 % Grown

The README.md

phpcs 2.0+ Laravel 4/5 Command

Build Status Latest Stable Version License, (*1)

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., (*2)

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., (*3)

Setup

Require this package in composer:, (*4)

$ composer require chefsplate/sniffer-rules

Laravel 4/5

In your config/app.php add ChefsPlate\SnifferRules\ServiceProvider:class to $providers array:, (*5)

'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, (*6)

Edit configuration file config/sniffer-rules.php to tweak the sniffer behavior., (*7)

Manual

Install our Standard by configuring PHP_CodeSniffer to look for it., (*8)

$ 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:, (*9)

$ 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., (*10)

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, (*11)

The Versions

05/07 2017

dev-master

9999999-dev https://github.com/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.

  Sources   Download

MIT

The Requires

 

by ChefsPlate Development Team

laravel phpcs lumen laravel 4 cli artisan laravel 5 code sniffer squizlabs

05/07 2017

1.0.0

1.0.0.0 https://github.com/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.

  Sources   Download

MIT

The Requires

 

by ChefsPlate Development Team

laravel phpcs lumen laravel 4 cli artisan laravel 5 code sniffer squizlabs