Apply phpcbf to automatically fix coding standards errors

Avant

Commande : ./vendor/bin/phpcs --report=source -n src/

Résultat :

PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
-------------------------------------------------------------------------------------------
    STANDARD  CATEGORY            SNIFF                                               COUNT
-------------------------------------------------------------------------------------------
[ ] Generic   Commenting          Doc comment non param group                         118
[ ] PEAR      Commenting          Class comment missing category tag                  79
[ ] PEAR      Commenting          File comment missing                                78
[ ] PEAR      Commenting          Class comment missing author tag                    76
[ ] PEAR      Commenting          Class comment missing license tag                   76
[ ] PEAR      Commenting          Class comment missing link tag                      76
[ ] PEAR      Commenting          Class comment missing package tag                   66
[ ] PEAR      Commenting          Function comment missing                            53
[ ] PEAR      Commenting          Function comment missing param tag                  43
[ ] PEAR      Naming conventions  Valid variable name public underscore               39
[ ] PEAR      Commenting          Function comment missing param comment              32
[x] PEAR      Functions           Function call signature indent                      32
[ ] PEAR      Commenting          Function comment missing param name                 31
[x] Generic   Commenting          Doc comment tag value indent                        26
[ ] PEAR      Commenting          Function comment missing return                     24
[x] Squiz     Commenting          Doc comment alignment space before star             22
[x] PEAR      Functions           Function call signature close bracket line          18
[ ] Generic   Commenting          Doc comment missing short                           16
[x] PEAR      Commenting          Function comment spacing after param type           16
[ ] PEAR      Commenting          Function comment spacing after                      12
[x] PEAR      Commenting          Function comment spacing after param name           12
[x] PEAR      Functions           Function call signature content after open bracket  11
[ ] PEAR      Control structures  Control signature found                             10
[ ] PEAR      Commenting          Class comment missing                               9
[ ] PEAR      Commenting          File comment missing category tag                   9
[ ] PEAR      Naming conventions  Valid function name public underscore               7
[ ] PEAR      Commenting          File comment missing author tag                     6
[ ] PEAR      Commenting          File comment missing package tag                    6
[ ] PEAR      Naming conventions  Valid function name private no underscore           6
[x] Generic   Commenting          Doc comment spacing before tags                     5
[ ] PEAR      Commenting          File comment incomplete copyright                   5
[ ] PEAR      Commenting          File comment license tag order                      5
[ ] PEAR      Commenting          File comment link tag order                         5
[ ] PEAR      Commenting          File comment since tag order                        5
[ ] Generic   Commenting          Doc comment short not capital                       4
[ ] PEAR      Commenting          File comment missing link tag                       4
[ ] PEAR      Commenting          File comment wrong style                            4
[ ] PEAR      Commenting          Class comment wrong style                           3
[ ] PEAR      Commenting          Function comment param name no match                3
[x] PEAR      White space         Scope indent incorrect exact                        3
[ ] Generic   Commenting          Doc comment empty                                   2
[x] PEAR      White space         Scope closing brace indent                          2
[x] PEAR      White space         Scope indent incorrect                              2
[ ] Generic   Commenting          Doc comment param not first                         1
[ ] PEAR      Commenting          File comment missing license tag                    1
[ ] PEAR      Commenting          Function comment wrong style                        1
[x] PEAR      Control structures  Multi line condition spacing after open brace       1
[x] PEAR      Control structures  Multi line condition start with boolean             1
[ ] PEAR      Formatting          Multi line assignment equal sign line               1
[ ] PEAR      Functions           Valid default value not at end                      1
[ ] PEAR      Naming conventions  Valid class name start with capital                 1
-------------------------------------------------------------------------------------------
A TOTAL OF 1069 SNIFF VIOLATIONS WERE FOUND IN 51 SOURCES
-------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SOURCES AUTOMATICALLY (151 VIOLATIONS IN TOTAL)
-------------------------------------------------------------------------------------------

Time: 809ms; Memory: 22MB

Après

Commande : ./vendor/bin/phpcbf src/

PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
----------------------------------------------------------------------------------
    STANDARD  CATEGORY            SNIFF                                      COUNT
----------------------------------------------------------------------------------
[ ] Generic   Commenting          Doc comment non param group                117
[ ] PEAR      Commenting          Class comment missing category tag         79
[ ] PEAR      Commenting          File comment missing                       78
[ ] PEAR      Commenting          Class comment missing author tag           76
[ ] PEAR      Commenting          Class comment missing license tag          76
[ ] PEAR      Commenting          Class comment missing link tag             76
[ ] PEAR      Commenting          Class comment missing package tag          66
[ ] PEAR      Commenting          Function comment missing                   53
[ ] PEAR      Commenting          Function comment missing param tag         42
[ ] PEAR      Naming conventions  Valid variable name public underscore      39
[ ] PEAR      Commenting          Function comment missing param comment     32
[ ] PEAR      Commenting          Function comment missing param name        31
[x] Generic   Commenting          Doc comment tag value indent               27
[ ] PEAR      Commenting          Function comment missing return            24
[x] PEAR      Functions           Function call signature indent             20
[ ] Generic   Commenting          Doc comment missing short                  16
[x] PEAR      Commenting          Function comment spacing after param type  16
[ ] PEAR      Commenting          Function comment spacing after             12
[x] PEAR      Commenting          Function comment spacing after param name  12
[ ] PEAR      Control structures  Control signature found                    10
[ ] PEAR      Commenting          Class comment missing                      9
[ ] PEAR      Commenting          File comment missing category tag          9
[ ] PEAR      Naming conventions  Valid function name public underscore      7
[ ] PEAR      Commenting          File comment missing author tag            6
[ ] PEAR      Commenting          File comment missing package tag           6
[ ] PEAR      Naming conventions  Valid function name private no underscore  6
[ ] PEAR      Commenting          File comment incomplete copyright          5
[ ] PEAR      Commenting          File comment license tag order             5
[ ] PEAR      Commenting          File comment link tag order                5
[ ] PEAR      Commenting          File comment since tag order               5
[ ] Generic   Commenting          Doc comment short not capital              4
[ ] PEAR      Commenting          File comment missing link tag              4
[ ] PEAR      Commenting          File comment wrong style                   4
[x] Generic   Commenting          Doc comment spacing after                  3
[ ] PEAR      Commenting          Class comment wrong style                  3
[x] PEAR      White space         Scope indent incorrect exact               3
[ ] Generic   Commenting          Doc comment empty                          2
[ ] PEAR      Commenting          Function comment param name no match       2
[x] PEAR      White space         Scope closing brace indent                 2
[x] PEAR      White space         Scope indent incorrect                     2
[x] Squiz     Commenting          Doc comment alignment no space after star  2
[ ] Generic   Commenting          Doc comment param not first                1
[ ] PEAR      Commenting          File comment missing license tag           1
[ ] PEAR      Commenting          Function comment wrong style               1
[ ] PEAR      Formatting          Multi line assignment equal sign line      1
[ ] PEAR      Functions           Valid default value not at end             1
[ ] PEAR      Naming conventions  Valid class name start with capital        1
----------------------------------------------------------------------------------
A TOTAL OF 1002 SNIFF VIOLATIONS WERE FOUND IN 47 SOURCES
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SOURCES AUTOMATICALLY (87 VIOLATIONS IN TOTAL)
----------------------------------------------------------------------------------

Remarque: IntelliJ recorrige des points sur lesquels phpcs n'est pas d'accord (pas grave)

Avant PSR12

Commande : ./vendor/bin/phpcs --report=source --standard=PSR12 -n src/

PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
--------------------------------------------------------------------------------------------------
    STANDARD  CATEGORY            SNIFF                                                      COUNT
--------------------------------------------------------------------------------------------------
[x] PSR2      Methods             Function call signature multiple arguments                 143
[x] PSR2      Methods             Function closing brace spacing before close                25
[x] PSR12     Operators           Operator spacing no space before                           24
[x] PSR12     Operators           Operator spacing no space after                            22
[x] PSR2      Methods             Function call signature indent                             20
[x] Squiz     White space         Control structure spacing spacing before close             16
[ ] Squiz     Scope               Method scope missing                                       13
[x] Squiz     White space         Control structure spacing spacing after open               13
[x] PSR2      Classes             Class declaration close brace after body                   12
[x] Squiz     White space         Scope keyword spacing incorrect                            11
[ ] PSR2      Methods             Method declaration underscore                              10
[x] Squiz     Control structures  Control signature space after close brace                  6
[x] Squiz     White space         Superfluous whitespace end line                            4
[x] Squiz     Functions           Function declaration argument spacing no space before arg  3
[x] Generic   White space         Scope indent incorrect                                     2
[x] Generic   White space         Scope indent incorrect exact                               2
[x] PSR12     Classes             Class instantiation missing parentheses                    2
[x] Squiz     Control structures  Control signature space after close parenthesis            2
[x] Squiz     Control structures  Control signature space after keyword                      2
[x] Squiz     White space         Scope closing brace indent                                 2
[x] Generic   Formatting          Disallow multiple statements same line                     1
[ ] PEAR      Functions           Valid default value not at end                             1
[x] PSR2      Control structures  Switch declaration space before colon CASE                 1
[x] PSR2      Files               End file newline none found                                1
[x] PSR2      Files               End file newline too many                                  1
[ ] Squiz     Classes             Valid class name not camel caps                            1
[x] Squiz     Functions           Function declaration argument spacing space after default  1
[x] Squiz     Functions           Function declaration argument spacing space before equals  1
--------------------------------------------------------------------------------------------------
A TOTAL OF 342 SNIFF VIOLATIONS WERE FOUND IN 28 SOURCES
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 24 MARKED SOURCES AUTOMATICALLY (317 VIOLATIONS IN TOTAL)
--------------------------------------------------------------------------------------------------

Time: 1.06 secs; Memory: 22MB

Après PSR12

Commande : ``

PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
-------------------------------------------------------------------------------
    STANDARD  CATEGORY            SNIFF                                   COUNT
-------------------------------------------------------------------------------
[x] PSR2      Methods             Function call signature indent          18
[ ] PSR2      Methods             Method declaration underscore           10
[ ] Squiz     Scope               Method scope missing                    2
[x] Generic   Formatting          Disallow multiple statements same line  1
[ ] PEAR      Functions           Valid default value not at end          1
[ ] Squiz     Classes             Valid class name not camel caps         1
-------------------------------------------------------------------------------
A TOTAL OF 33 SNIFF VIOLATIONS WERE FOUND IN 6 SOURCES
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SOURCES AUTOMATICALLY (19 VIOLATIONS IN TOTAL)
-------------------------------------------------------------------------------

Time: 857ms; Memory: 22MB
Edited by Matthieu FAURE