PHP-CS-Fixer icon indicating copy to clipboard operation
PHP-CS-Fixer copied to clipboard

feat: Symfony.trailing_comma_in_multiline - adjust configuration

Open keradus opened this issue 1 year ago • 1 comments

haha, another case how to handle config configuration that is dependent on PHP version

keradus avatar Aug 07 '24 22:08 keradus

Coverage Status

coverage: 95.128% (+0.002%) from 95.126% when pulling ee62cf040e12218597d5059c9677ef6211491057 on keradus:asd into 1e4b0f237b8465b52197aae26814e188178e3bfb on PHP-CS-Fixer:master.

coveralls avatar Aug 07 '24 22:08 coveralls

thanks @SpacePossum

for after_heredoc, moving to separated PR: #8188

keradus avatar Aug 30 '24 22:08 keradus

Are we supposed to run php-cs-fixer on the minimum supported PHP version in a project? What am I supposed to do for a library that still supports PHP 7.4, but my local installation of PHP is 8.3?

spawnia avatar Sep 01 '24 09:09 spawnia

@spawnia if your library still supports PHP 7.4, as PHP CS Fixer itself, you need to go with only PHP 7.4 options, as PHP CS Fixer itself does: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.64.0/src/RuleSet/Sets/PhpCsFixerSet.php#L123

kubawerlos avatar Sep 01 '24 09:09 kubawerlos

I see, so there is no version detection magic going on. We are extending the Symfony config, which explains why this change broke our project. Thank you for the response.

spawnia avatar Sep 01 '24 09:09 spawnia

No, there is no such detection, might happen in the future, there is a discussion about this: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/7312.

kubawerlos avatar Sep 01 '24 09:09 kubawerlos