2017 © Pedro Peláez
 

coding-standard symfony3-custom-coding-standard

image

endouble/symfony3-custom-coding-standard

  • Monday, July 30, 2018
  • by thanosp
  • Repository
  • 4 Watchers
  • 8 Stars
  • 29,054 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 107 Forks
  • 2 Open issues
  • 26 Versions
  • 14 % Grown

The README.md

Symfony3 Custom PHP CodeSniffer Coding Standard

This is a fork of https://github.com/djoos/Symfony2-coding-standard These are the Symfony2 standards, but tweaked to meet some needs we have in our CSB project, for example to comply with PSR-12 for PHP 7, (*1)

Installation

Composer

This standard can be installed with the Composer dependency manager., (*2)

  1. Add the repository to your composer.json:
 "repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:Endouble/Symfony3-custom-coding-standard"
        }
  1. Add the coding standard as a dependency of your project
 "require-dev": {
        "endouble/symfony3-custom-coding-standard": "^2.10"
    },
  1. Add the coding standard to the PHP_CodeSniffer install path

The path is relative to the php_codesniffer install path. This is important to make it work both in your vagrant, local machine and PHPStorm, (*3)

    bin/phpcs --config-set installed_paths ../../endouble/symfony3-custom-coding-standard
  1. Check the installed coding standards for "Symfony2", (*4)

    bin/phpcs -i
  2. Done!, (*5)

    bin/phpcs --standard=Symfony3Custom /path/to/code, (*6)

  3. (optional) Set up PHPStorm, (*7)

  • configure code sniffer under Languages & Frameworks -> PHP -> Code Sniffer
  • Go to Editor -> Inspections -> PHP Code sniffer, refresh the standards and select Symfony3Custom

Customizations

The following adjustments have been made to the original standard:, (*8)

In Sniff/WhiteSpace/AssignmentSpacingSniff: - Added an exception for declare(strict_types=1); to comply with PSR-12, (*9)

In Sniff/WhiteSpace/FunctionalClosingBraceSniff: - copied from Squiz and adapted to have no blank line at the end of a function, (*10)

In Sniff/Commenting/FunctionCommentSniff: - check for 1 blank line above a docblock - don't check docblocks for test and setUp methods (PHPunit, would be blank) - do check protected and private methods for docblocks, (*11)

In Sniff/NamingConventions/ValidClassNameSniff - remove the abstract class name rule, (*12)

In ruleset.xml - Disabled the class comment rule - Changed the concatenation spacing rule, for readability, to require 1 space around concatenation dot, instead of no spaces as the Symfony standard requires. - Re-enabled the blank line check from superfluousWhitespace (disabled in PSR-2), (*13)

The Versions

30/07 2018

1.x-dev

1.9999999.9999999.9999999-dev

  Sources   Download

31/03 2018

1.0.0

1.0.0.0

  Sources   Download

31/03 2018

2.0.0

2.0.0.0

  Sources   Download

31/03 2018

2.0.1

2.0.1.0

  Sources   Download

22/03 2017

dev-master

9999999-dev https://github.com/Endouble/Symfony3-coding-standard

Customized CodeSniffer ruleset for the Symfony3 projects

  Sources   Download

MIT

The Requires

 

phpcs symfony3 coding standard

22/03 2017

2.17

2.17.0.0 https://github.com/Endouble/Symfony3-coding-standard

Customized CodeSniffer ruleset for the Symfony3 projects

  Sources   Download

MIT

The Requires

 

phpcs symfony3 coding standard

22/03 2017

dev-allow_concat_multiline

dev-allow_concat_multiline https://github.com/Endouble/Symfony3-coding-standard

Customized CodeSniffer ruleset for the Symfony3 projects

  Sources   Download

MIT

The Requires

 

phpcs symfony3 coding standard

16/06 2016

2.16

2.16.0.0 https://github.com/Endouble/Symfony3-coding-standard

Customized CodeSniffer ruleset for the Symfony3 projects

  Sources   Download

MIT

The Requires

 

phpcs symfony3 coding standard

16/06 2016

2.15

2.15.0.0 https://github.com/Endouble/Symfony3-coding-standard

Customized CodeSniffer ruleset for the Symfony3 projects

  Sources   Download

MIT

The Requires

 

phpcs symfony3 coding standard

16/06 2016

2.14

2.14.0.0 https://github.com/Endouble/Symfony3-coding-standard

Customized CodeSniffer ruleset for the Symfony3 projects

  Sources   Download

MIT

The Requires

 

phpcs symfony3 coding standard

28/04 2016

2.11

2.11.0.0 https://github.com/Endouble/Symfony3-coding-standard

Customized CodeSniffer ruleset for the Symfony3 projects

  Sources   Download

MIT

The Requires

 

phpcs symfony3 coding standard

26/04 2016

2.10.1

2.10.1.0 https://github.com/Endouble/Symfony3-coding-standard

Customized CodeSniffer ruleset for the Symfony3 projects

  Sources   Download

MIT

The Requires

 

phpcs symfony3 coding standard

26/04 2016

2.10

2.10.0.0 https://github.com/Endouble/Symfony3-coding-standard

Customized CodeSniffer ruleset for the Symfony3 projects

  Sources   Download

MIT

The Requires

 

phpcs symfony3 coding standard

14/03 2016

2.9.1

2.9.1.0 https://github.com/escapestudios/Symfony2-coding-standard

CodeSniffer ruleset for the Symfony2 coding standard

  Sources   Download

MIT

The Requires

 

phpcs symfony2 coding standard

22/01 2016

2.9.0

2.9.0.0 https://github.com/escapestudios/Symfony2-coding-standard

CodeSniffer ruleset for the Symfony2 coding standard

  Sources   Download

MIT

The Requires

 

phpcs symfony2 coding standard

01/12 2015

2.8.1

2.8.1.0 https://github.com/escapestudios/Symfony2-coding-standard

CodeSniffer ruleset for the Symfony2 coding standard

  Sources   Download

MIT

The Requires

 

phpcs symfony2 coding standard

19/11 2015

2.8.0

2.8.0.0 https://github.com/escapestudios/Symfony2-coding-standard

CodeSniffer ruleset for the Symfony2 coding standard

  Sources   Download

MIT

The Requires

 

phpcs symfony2 coding standard

28/08 2015

2.7.0

2.7.0.0 https://github.com/escapestudios/Symfony2-coding-standard

CodeSniffer ruleset for the Symfony2 coding standard

  Sources   Download

MIT

The Requires

 

phpcs symfony2 coding standard

18/06 2015

2.6.0

2.6.0.0 https://github.com/escapestudios/Symfony2-coding-standard

CodeSniffer ruleset for the Symfony2 coding standard

  Sources   Download

MIT

The Requires

 

phpcs symfony2 coding standard

28/05 2015

2.5.0

2.5.0.0 https://github.com/escapestudios/Symfony2-coding-standard

CodeSniffer ruleset for the Symfony2 coding standard

  Sources   Download

MIT

The Requires

 

phpcs symfony2 coding standard

14/04 2015

2.4.0

2.4.0.0 https://github.com/escapestudios/Symfony2-coding-standard

CodeSniffer ruleset for the Symfony2 coding standard

  Sources   Download

MIT

The Requires

 

phpcs symfony2 coding standard

11/04 2015

2.3.1

2.3.1.0 https://github.com/escapestudios/Symfony2-coding-standard

CodeSniffer ruleset for the Symfony2 coding standard

  Sources   Download

MIT

The Requires

 

phpcs symfony2 coding standard

11/04 2015

2.3.0

2.3.0.0 https://github.com/escapestudios/Symfony2-coding-standard

CodeSniffer ruleset for the Symfony2 coding standard

  Sources   Download

MIT

The Development Requires

phpcs symfony2 coding standard

10/04 2015

2.2.0

2.2.0.0 https://github.com/escapestudios/Symfony2-coding-standard

CodeSniffer ruleset for the Symfony2 coding standard

  Sources   Download

MIT

The Development Requires

phpcs symfony2 coding standard

10/04 2015

2.1.1

2.1.1.0 https://github.com/escapestudios/Symfony2-coding-standard

CodeSniffer ruleset for the Symfony2 coding standard

  Sources   Download

MIT

phpcs symfony2 coding standard

10/04 2015

2.1.0

2.1.0.0 https://github.com/escapestudios/Symfony2-coding-standard

CodeSniffer ruleset for the Symfony2 coding standard

  Sources   Download

MIT

phpcs symfony2 coding standard