Php-cs-fixer: RuntimeException on install

Created on 3 Feb 2018  ·  5Comments  ·  Source: FriendsOfPHP/PHP-CS-Fixer

For configuration or updating questions please read the README and UPGRADE documentation,
or visit: https://gitter.im/PHP-CS-Fixer

When reporting an issue (bug) please provide the following information:

The PHP version you are using ($ php -v):

7.1.7

PHP CS Fixer version you are using ($ php-cs-fixer -V):

N/A, unable to install

The command you use to run PHP CS Fixer:

composer global require friendsofphp/php-cs-fixer
yields...

[RuntimeException]
Could not scan for classes inside "/Users/stevenzeck/.composer/vendor/friendsofphp/php-cs-fixer/tests/Test/InternalIntegrationCaseFactory.php" which does not appear to be a file nor a folder

The configuration file you are using, if any:

N/A

If applicable, please provide minimum samples of PHP code (as plain text, not screenshots):

  • before running PHP CS Fixer (no changes):
    N/A

  • with unexpected changes applied when running PHP CS Fixer:
    N/A

  • with the changes you expected instead:
    N/A

Most helpful comment

ker@dus:~ λ php-cs-fixer --version
PHP CS Fixer 2.9.3 Speechless by Fabien Potencier and Dariusz Ruminski
ker@dus:~ λ composer global require friendsofphp/php-cs-fixer
Changed current directory to /home/keradus/.composer
Using version ^2.10 for friendsofphp/php-cs-fixer      
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)          
Package operations: 0 installs, 1 update, 0 removals
  - Updating friendsofphp/php-cs-fixer (v2.9.3 => v2.10.2): Loading from cache
Writing lock file
Generating autoload files
ker@dus:~ λ php-cs-fixer --version
PHP CS Fixer 2.10.2 Bowling Bear by Fabien Potencier and Dariusz Ruminski
ker@dus:~ λ

I just released new 2.2.x, 2.9.x and 2.10.x

All 5 comments

I can confirm I am experiencing the same issue (running on Arch Linux and using PHP 7.2.2). Already removed the vendor folder and also cleared Composer's cache, but issue still happens.

Problem is that the files exists and is in composer autoload classmap here: https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/2.10/composer.json#L66 and ignored for export in gitattributes here: https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/2.10/.gitattributes#L9.

One of them has to be removed.

ker@dus:~ λ php-cs-fixer --version
PHP CS Fixer 2.9.3 Speechless by Fabien Potencier and Dariusz Ruminski
ker@dus:~ λ composer global require friendsofphp/php-cs-fixer
Changed current directory to /home/keradus/.composer
Using version ^2.10 for friendsofphp/php-cs-fixer      
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)          
Package operations: 0 installs, 1 update, 0 removals
  - Updating friendsofphp/php-cs-fixer (v2.9.3 => v2.10.2): Loading from cache
Writing lock file
Generating autoload files
ker@dus:~ λ php-cs-fixer --version
PHP CS Fixer 2.10.2 Bowling Bear by Fabien Potencier and Dariusz Ruminski
ker@dus:~ λ

I just released new 2.2.x, 2.9.x and 2.10.x

Thanks for the quick resolution! I can confirm it works fine now.

Thanks a lot, @keradus, now enjoy your time off!

Was this page helpful?
0 / 5 - 0 ratings