Php-cs-fixer: Priority issue: phpdoc_types_order should run before no_superfluous_phpdoc_tags

Created on 2 Jul 2018  ·  1Comment  ·  Source: FriendsOfPHP/PHP-CS-Fixer

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

PHP 7.1.18 (cli) (built: May 25 2018 19:18:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.18, Copyright (c) 1999-2018, by Zend Technologies

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

PHP CS Fixer 2.12.1 Long Journey by Fabien Potencier and Dariusz Ruminski

The command you use to run PHP CS Fixer:

vendor/bin/php-cs-fixer fix -v --using-cache=no

The configuration file you are using, if any:

Basically the same as dmvdbrugge/dynamic-components, except explicit_string_variable, header_comment, no_alternative_syntax, and no_unset_on_property

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

  • before running PHP CS Fixer (no changes):
/**
 * @param null|string $myStr
 */
public function testFunc(?string $myStr);
  • after first run:
/**
 * @param string|null $myStr
 */
public function testFunc(?string $myStr);
  • after second run:
public function testFunc(?string $myStr);
  • expected:
    Immediately arrive at the last step

This _could_ also be seen as a bug in no_superfluous_phpdoc_tags that it doesn't think null|string is superfluous, whereas it (rightfully) does think so about string|null.

Meta: this is case 4 of #3844

kinbug

Most helpful comment

This could also be seen as a bug in no_superfluous_phpdoc_tags that it doesn't think null|string is superfluous, whereas it (rightfully) does think so about string|null.

Indeed I would consider it a bug in no_superfluous_phpdoc_tags.

>All comments

This could also be seen as a bug in no_superfluous_phpdoc_tags that it doesn't think null|string is superfluous, whereas it (rightfully) does think so about string|null.

Indeed I would consider it a bug in no_superfluous_phpdoc_tags.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BackEndTea picture BackEndTea  ·  3Comments

vitek-rostislav picture vitek-rostislav  ·  3Comments

EvgenyOrekhov picture EvgenyOrekhov  ·  3Comments

kcloze picture kcloze  ·  3Comments

UksusoFF picture UksusoFF  ·  3Comments