2017 © Pedro Peláez
 

library sniffer-rules

A Lumen 5 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

socialengine/sniffer-rules

A Lumen 5 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.

  • Friday, September 29, 2017
  • by Danno040
  • Repository
  • 14 Watchers
  • 14 Stars
  • 36,599 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 14 Versions
  • 4 % Grown

The README.md

phpcs 2.0+ Laravel 5, Lumen 5 Command

Build Status Latest Stable Version License, (*1)

This is a Laravel 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 SocialEngine., (*3)

Setup

Require this package in composer:, (*4)

$ composer require socialengine/sniffer-rules

Laravel 5

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

'providers' => [
    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',

    'SocialEngine\SnifferRules\ServiceProvider',

],

Laravel 5: Publish the configuration file

$ php artisan vendor:publish

Manual

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

$ php ./vendor/bin/phpcs --config-set installed_paths ./vendor/socialengine/src/Socialengine/SnifferRules/Standard/

Usage

Laravel

$ php artisan sniff

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

$ php artisan sniff -n

Manual

$ php ./vendor/bin/phpcs --standard=SocialEngine 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., (*8)

Travis

In combination with the Makefile, Travis has issues finding the standard, we had to add a before_script to make it work. See Unum repo for example., (*9)

before_script: php ./vendor/bin/phpcs --config-set installed_paths "`pwd`/vendor/socialengine/sniffer-rules/src/SocialEngine/SnifferRules/Standard/"

SocialEngine Coding Standards

Coding standards

Addendum and Clarifications

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

License

MIT, (*10)

The Versions

29/09 2017

dev-master

9999999-dev https://github.com/socialengine/sniffer-rules

A Lumen 5 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 SocialEngine Development Team

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

29/09 2017

2.3.0

2.3.0.0 https://github.com/socialengine/sniffer-rules

A Lumen 5 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 SocialEngine Development Team

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

09/10 2015

2.2.1

2.2.1.0 https://github.com/socialengine/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 SocialEngine Development Team

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

08/10 2015

2.2.0

2.2.0.0 https://github.com/socialengine/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 SocialEngine Development Team

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

01/09 2015

2.1.3

2.1.3.0 https://github.com/socialengine/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 SocialEngine Development Team

laravel phpcs laravel 4 cli artisan laravel 5 code sniffer squizlabs

24/08 2015

2.1.2

2.1.2.0 https://github.com/socialengine/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 SocialEngine Development Team

laravel phpcs laravel 4 cli artisan laravel 5 code sniffer squizlabs

24/08 2015

2.1.1

2.1.1.0 https://github.com/socialengine/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 SocialEngine Development Team

laravel phpcs laravel 4 cli artisan laravel 5 code sniffer squizlabs

11/05 2015

2.1.0

2.1.0.0 https://github.com/socialengine/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 SocialEngine Development Team

laravel phpcs laravel 4 cli artisan laravel 5 code sniffer squizlabs

01/05 2015

2.0.1

2.0.1.0

SocialEngine Sniffer Rules detect violations of a defined coding standard. It helps your code remains clean and consistent.

  Sources   Download

The Requires

 

by SocialEngine Development Team

31/03 2015

2.0.0

2.0.0.0

SocialEngine Sniffer Rules detect violations of a defined coding standard. It helps your code remains clean and consistent.

  Sources   Download

The Requires

 

by SocialEngine Development Team

14/10 2014

1.0.3

1.0.3.0

SocialEngine Sniffer Rules detect violations of a defined coding standard. It helps your code remains clean and consistent.

  Sources   Download

The Requires

 

by SocialEngine Development Team

06/10 2014

1.0.2

1.0.2.0

SocialEngine Sniffer Rules detect violations of a defined coding standard. It helps your code remains clean and consistent.

  Sources   Download

The Requires

 

by SocialEngine Development Team

23/09 2014

1.0.1

1.0.1.0

SocialEngine Sniffer Rules detect violations of a defined coding standard. It helps your code remains clean and consistent.

  Sources   Download

The Requires

 

by SocialEngine Development Team

20/09 2014

1.0.0

1.0.0.0

SocialEngine Sniffer Rules detect violations of a defined coding standard. It helps your code remains clean and consistent.

  Sources   Download

The Requires

 

by SocialEngine Development Team