Skip to content

PhpStorm can't read a ruleset file for the PHP CS Fixer #1236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
szymongalecki opened this issue Oct 24, 2024 · 2 comments
Open

PhpStorm can't read a ruleset file for the PHP CS Fixer #1236

szymongalecki opened this issue Oct 24, 2024 · 2 comments
Assignees

Comments

@szymongalecki
Copy link

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

  1. curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/onelinesetup | bash -s -- magento.test 2.4.7 community
  2. bin/magento sampledata:deploy
  3. bin/magento setup:upgrade
  4. Successfully setup PHP CodeSniffer using steps described in tutorial
  5. Setup PHP CS Fixer using steps described in tutorial
  6. 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
@PCodrin
Copy link

PCodrin commented Dec 27, 2024

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

@markshust
Copy link
Owner

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.

@markshust markshust self-assigned this Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants