2017 © Pedro Peláez
 

php-code-sniffer php_standard

PHP coding standard to be followed at Froiden

image

froiden/php_standard

PHP coding standard to be followed at Froiden

  • Thursday, March 30, 2017
  • by shashankkrjain
  • Repository
  • 3 Watchers
  • 2 Stars
  • 53 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

PHP Coding Standard

This repository contains rulesets for PHP CodeSniffer and PHP Mess Detector along with some custom rules. These standards are followed internally at Froiden (www.froiden.com), (*1)

Installation

Install this repository globally using composer:, (*2)

composer global require froiden/php_standard

Always use the latest version of the repository., (*3)

Setup

The project will be installed in global composer folder on your PC. * Mac: .composer/vendor folder in your home directory * Windows: AppData/Roaming/Composer/vendor folder in your user directory * Ubuntu: .config/composer/vendor folder in your home directory, (*4)

You follow the steps respective to your favourite IDE to configure PHP CodeSniffer and PHP MessDetector and point to the two rulesets in the installation folder. * ruleset.xml - For CodeSniffer * rulesetmd.xml - For MessDetector, (*5)

Attribution

Some sniffs in this repository have been derived from original PHP_CodeSniffer project. Credits for those go to the respective developers., (*6)

VS Code SETUP

Install the extension name PHP Sniffer by wongjn, (*7)

N|Solid After Activation add the below file to settings.json file, (*8)

For Mac, (*9)

"phpSniffer.standard": "~/.composer/vendor/froiden/php_standard/ruleset.xml",

For Linux, (*10)

"phpSniffer.standard": "~/.config/composer/vendor/froiden/php_standard/ruleset.xml",

For Windows, (*11)

"phpSniffer.standard": "%userprofile%/AppData/Roaming/Composer/vendor/froiden/php_standard/ruleset.xml",

N|Solid, (*12)

To check, (*13)

phpcs --standard=<PATH_OF_RULESET> <SPACE> <PATH_OF_FILEs_CHECK>

TO fix, (*14)

phpcbf --standard=<PATH_OF_RULESET> <SPACE> <PATH_OF_FILEs_CHECK>

Ignoring a file, (*15)

// @codingStandardsIgnoreFile

// phpcs:ignoreFile

Ignoring a line, (*16)

// @codingStandardsIgnoreLine

// phpcs:ignore

Ignoring a block, (*17)

// @codingStandardsIgnoreStart

// phpcs:disable

// @codingStandardsIgnoreEnd

// phpcs:enable

The Versions

30/03 2017

dev-master

9999999-dev

PHP coding standard to be followed at Froiden

  Sources   Download

MIT

The Requires

 

by Shashank Jain

20/02 2017

v1.0.6

1.0.6.0

PHP coding standard to be followed at Froiden

  Sources   Download

MIT

The Requires

 

by Shashank Jain

20/10 2016

v1.0.5

1.0.5.0

PHP coding standard to be followed at Froiden

  Sources   Download

MIT

The Requires

 

by Shashank Jain

18/07 2016

v1.0.4

1.0.4.0

PHP coding standard to be followed at Froiden

  Sources   Download

MIT

The Requires

 

by Shashank Jain

13/07 2016

v1.0.3

1.0.3.0

PHP coding standard to be followed at Froiden

  Sources   Download

MIT

The Requires

 

by Shashank Jain

30/06 2016

v1.0.2

1.0.2.0

PHP coding standard to be followed at Froiden

  Sources   Download

MIT

The Requires

 

by Shashank Jain

30/06 2016

v1.0.1

1.0.1.0

PHP coding standard to be followed at Froiden

  Sources   Download

MIT

The Requires

 

by Shashank Jain

30/06 2016

v1.0.0

1.0.0.0

PHP coding standard to be followed at Froiden

  Sources   Download

MIT

The Requires

 

by Shashank Jain