PhpStorm can't read a ruleset file for the PHP CS Fixer
Description I followed the tutorial and went with the automated one line setup. All of the described steps worked for me apart from properly setting up the PHP CS Fixer. I am using an M1 Macbook, Magento 2.4.7 and PHP 8.3.6.
Steps To Reproduce
curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/onelinesetup | bash -s -- magento.test 2.4.7 communitybin/magento sampledata:deploybin/magento setup:upgrade- Successfully setup PHP CodeSniffer using steps described in tutorial
- Setup PHP CS Fixer using steps described in tutorial
- Selected path for the ruleset results in throwing an error
<MyComputer>/Magento/src/.php-cs-fixer.dist.php
Expected Result PHP CS Fixer is properly setup and functional.
Actual Result
PHP CS Fixer does not work, PhpStorm throws an error.
I can see that there is a space in front of the dotfile but it is only visible in the error message but it is not present in the path for the ruleset : <MyComputer>/Magento/src/.php-cs-fixer.dist.php
PHP CS Fixer: PHP CS Fixer 3.64.0 Space Sets by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.6
In ConfigurationResolver.php line 554:
[PhpCsFixer\ConfigurationException\InvalidConfigurationException (16)]
Cannot read config file "<MyComputer>/Magento/src/ .php-cs-fixer.dist.php".
Exception trace:
at /var/www/html/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php:554 PhpCsFixer\Console\ConfigurationResolver->computeConfigFiles()
at /var/www/html/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php:252 PhpCsFixer\Console\ConfigurationResolver->getConfig()
at /var/www/html/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php:283 PhpCsFixer\Console\ConfigurationResolver->getParallelConfig()
at /var/www/html/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php:264
I have the same problem on a Macbook M4 Pro. Any updates?
PHP CS Fixer: PHP CS Fixer 3.65.0 Persian Successor by Fabien Potencier, Dariusz Ruminski, and contributors.
PHP runtime: 8.3.14
In ConfigurationResolver.php line 554:
[PhpCsFixer\ConfigurationException\InvalidConfigurationException (16)]
Cannot read config file
Exception trace:
at /var/www/html/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php:554
PhpCsFixer\Console\ConfigurationResolver->computeConfigFiles()
at /var/www/html/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php:252
PhpCsFixer\Console\ConfigurationResolver->getConfig()
at /var/www/html/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php:283
PhpCsFixer\Console\ConfigurationResolver->getParallelConfig()
at /var/www/html/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php:262
I'm going to create some new video lessons for setting things up in PhpStorm, as JetBrains has changed a ton of things with their UI over the last couple years.
I'll leave this ticket open until I do so, and will post links to the lessons as soon as they are up. I don't think much if anything has actually changed, but their UI updates make things really confusing.