Php-cs-fixer: When check php-cs-fixer version got error "single_Import_per_statement" has invalid name

Created on 24 Nov 2020  ·  4Comments  ·  Source: FriendsOfPHP/PHP-CS-Fixer

Php -v:
PHP 7.4.12 (cli) (built: Oct 31 2020 17:04:25) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.12, Copyright (c), by Zend Technologies

I installed php-cs-fixer using composer with this command:
composer global require friendsofphp/php-cs-fixer

php-cs-fixer -v
giving me an error
PHP Fatal error: Uncaught UnexpectedValueException: Fixer named "single_Import_per_statement" has invalid name. in /home/ubuntu/.config/composer/vendor/friendsofphp/php-cs-fixer/src/FixerFactory.php:143

kinbug

Most helpful comment

You are welcome! Today, I will open a pull request about that issues.

All 4 comments

hi!
The name should be single_import_per_statement (lower case i). Please check your configuration file and adjust :)

hi!
Thank you for your answer.
Yes, i check core files and you are right the name should be lower case. no problem with my configuration.
I guess it's a bug. That's why I added bug label. I am using Turkish locale so
php -r "echo strtolower('ISTANBUL');" gives Istanbul not istanbul.
PhpCsFixer\Utils::camelCaseToUnderscore should be returns with mb_strtolower not strtolower.

that sounds like a bug indeed, thanks for reporting back and the details!

You are welcome! Today, I will open a pull request about that issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ndench picture ndench  ·  3Comments

carusogabriel picture carusogabriel  ·  3Comments

EvgenyOrekhov picture EvgenyOrekhov  ·  3Comments

kcloze picture kcloze  ·  3Comments

UksusoFF picture UksusoFF  ·  3Comments