|
1 | 1 | # Symfony3 Custom PHP CodeSniffer Coding Standard
|
2 | 2 |
|
3 |
| -This is a fork of [endouble/Symfony3-coding-standard](https://github.com/endouble/Symfony3-coding-standard). |
4 |
| -These are the Symfony standards, but tweaked to meet some needs I have in my project, for example to comply with |
5 |
| -[PSR-12](https://github.com/php-fig/fig-standards/blob/master/proposed/extended-coding-style-guide.md) for PHP 7. |
6 |
| - |
7 |
| -## Installation |
8 |
| - |
9 |
| -### Composer |
10 |
| - |
11 | 3 | This standard can be installed with the [Composer](https://getcomposer.org/) dependency manager.
|
12 | 4 |
|
13 | 5 | 1. Add the repository to your composer.json:
|
@@ -53,24 +45,3 @@ bin/phpcs --standard=Symfony3Custom /path/to/code
|
53 | 45 |
|
54 | 46 | - configure code sniffer under Languages & Frameworks -> PHP -> Code Sniffer
|
55 | 47 | - Go to Editor -> Inspections -> PHP Code sniffer, refresh the standards and select Symfony3Custom
|
56 |
| - |
57 |
| -## Customizations |
58 |
| - |
59 |
| -The following adjustments have been made to the original standard: |
60 |
| - |
61 |
| -In Sniff/WhiteSpace/AssignmentSpacingSniff: |
62 |
| -- Added an exception for ```declare(strict_types=1);``` to comply with [PSR-12](https://github.com/php-fig/fig-standards/blob/master/proposed/extended-coding-style-guide.md#3-declare-statements-namespace-and-use-declarations) |
63 |
| - |
64 |
| -In Sniff/WhiteSpace/FunctionalClosingBraceSniff: |
65 |
| -- copied from Squiz and adapted to have no blank line at the end of a function |
66 |
| - |
67 |
| -In Sniff/Commenting/FunctionCommentSniff: |
68 |
| -- check for 1 blank line above a docblock |
69 |
| -- don't check docblocks for test, setUp and tearDown methods (PHPunit, would be blank) |
70 |
| -- do check protected and private methods for docblocks |
71 |
| - |
72 |
| -In ruleset.xml |
73 |
| -- Disabled the class comment rule |
74 |
| -- Changed the concatenation spacing rule, for readability, to require 1 space around concatenation dot, instead of no spaces as the [Symfony](https://symfony.com/doc/current/contributing/code/standards.html#structure) standard requires. |
75 |
| -- Re-enabled the blank line check from superfluousWhitespace (disabled in PSR-2) |
76 |
| - |
0 commit comments