Skip to content

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

@szymongalecki

Description

@szymongalecki

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions