Php-cs-fixer: No blank lines between properties

Created on 24 May 2020  路  1Comment  路  Source: FriendsOfPHP/PHP-CS-Fixer

For configuration or updating questions please read the README and UPGRADE documentation,
or visit: https://gitter.im/PHP-CS-Fixer

When reporting an issue (bug) please provide the following information:

The PHP version you are using ($ php -v):

=> 7.4

PHP CS Fixer version you are using ($ php-cs-fixer -V):

=> 2.16.3

The command you use to run PHP CS Fixer:

=> ./vendor/bin/php-cs-fixer fix

If applicable, please provide minimum samples of PHP code (as plain text, not screenshots):

  • before running PHP CS Fixer (no changes):
<?php
class Example
{
    public const FOO = 1;
    public static $bar = [1, 2, 3];
    private bool $baz = false;
    private $qux = [];
    private float $quux = 5.0;
}
  • with unexpected changes applied when running PHP CS Fixer:
<?php
class Example
{
    public const FOO = 1;

    public static $bar = [1, 2, 3];

    private bool $baz = false;

    private $qux = [];

    private float $quux = 5.0;
}
  • with the changes you expected instead:
<?php
class Example
{
    public const FOO = 1;
    public static $bar = [1, 2, 3];
    private bool $baz = false;
    private $qux = [];
    private float $quux = 5.0;
}

According to PSR-12 it shouldn't be spaces between each property. Isn't? :smile:

Best,

kinfeature request

Most helpful comment

PHP CS Fixer doesn't have a PSR-12 ruleset yet (see #4502) but on v2.17, class_attributes_separation will allow what you want (#4875). Closing as there is nothing left to do here.

>All comments

PHP CS Fixer doesn't have a PSR-12 ruleset yet (see #4502) but on v2.17, class_attributes_separation will allow what you want (#4875). Closing as there is nothing left to do here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sennewood picture sennewood  路  3Comments

EvgenyOrekhov picture EvgenyOrekhov  路  3Comments

ndench picture ndench  路  3Comments

grachevko picture grachevko  路  3Comments

BackEndTea picture BackEndTea  路  3Comments