Php-cs-fixer: [Fatal Error] [LogicException] You must call one of in() or append() methods before iterating over a Finder.

Created on 14 Sep 2015  ·  6Comments  ·  Source: FriendsOfPHP/PHP-CS-Fixer

Hello !

I've updated with composer global update this weekend but since it, i have this error :

Exception trace:
 () at /Users/Jeremy/.composer/vendor/symfony/finder/Finder.php:698
 Symfony\Component\Finder\Finder->getIterator() at /Users/Jeremy/.composer/vendor/fabpot/php-cs-fixer/Symfony/CS/Fixer.php:139
 Symfony\CS\Fixer->fix() at /Users/Jeremy/.composer/vendor/fabpot/php-cs-fixer/Symfony/CS/Console/Command/FixCommand.php:371
 Symfony\CS\Console\Command\FixCommand->execute() at /Users/Jeremy/.composer/vendor/symfony/console/Command/Command.php:259
 Symfony\Component\Console\Command\Command->run() at /Users/Jeremy/.composer/vendor/symfony/console/Application.php:878
 Symfony\Component\Console\Application->doRunCommand() at /Users/Jeremy/.composer/vendor/symfony/console/Application.php:195
 Symfony\Component\Console\Application->doRun() at /Users/Jeremy/.composer/vendor/symfony/console/Application.php:126
 Symfony\Component\Console\Application->run() at /Users/Jeremy/.composer/vendor/fabpot/php-cs-fixer/php-cs-fixer:44


fix [--config CONFIG] [--config-file [CONFIG-FILE]] [--dry-run] [--level LEVEL] [--fixers FIXERS] [--diff] [--format FORMAT] [--] [<path>]

The finder component have been updated in the same time with the tool and other symfony component to 2.7 version.

dnoegel/php-xdg-base-dir              0.1                implementation of xdg base directory s...
doctrine/instantiator                 1.0.5              A small, lightweight utility to instan...
drush/drush                           dev-master 02f19c5 Drush is a command line shell and scri...
fabpot/php-cs-fixer                   v1.10              A tool to automatically fix PHP code s...
jakub-onderka/php-console-color       0.1                
jakub-onderka/php-console-highlighter v0.3.2             
nikic/php-parser                      v1.4.0             A PHP parser written in PHP
pear/console_table                    1.2.1              Library that makes it easy to build co...
phpdocumentor/reflection-docblock     2.0.4              
phpspec/prophecy                      v1.5.0             Highly opinionated mocking framework f...
phpunit/php-code-coverage             2.2.3              Library that provides collection, proc...
phpunit/php-file-iterator             1.4.1              FilterIterator implementation that fil...
phpunit/php-text-template             1.2.1              Simple template engine.
phpunit/php-timer                     1.0.7              Utility class for timing
phpunit/php-token-stream              1.4.6              Wrapper around PHP's tokenizer extension.
phpunit/phpunit                       4.8.7              The PHP Unit Testing framework.
phpunit/phpunit-mock-objects          2.3.7              Mock Object library for PHPUnit
psy/psysh                             v0.5.2             An interactive shell for modern PHP.
sebastian/comparator                  1.2.0              Provides the functionality to compare ...
sebastian/diff                        1.3.0              Diff implementation
sebastian/environment                 1.3.2              Provides functionality to handle HHVM/...
sebastian/exporter                    1.2.1              Provides the functionality to export P...
sebastian/global-state                1.0.0              Snapshotting of global state
sebastian/recursion-context           1.0.1              Provides functionality to recursively ...
sebastian/version                     1.0.6              Library that helps with managing the v...
symfony/console                       v2.7.4             Symfony Console Component
symfony/event-dispatcher              v2.7.4             Symfony EventDispatcher Component
symfony/filesystem                    v2.7.4             Symfony Filesystem Component
symfony/finder                        v2.7.4             Symfony Finder Component
symfony/process                       v2.7.4             Symfony Process Component
symfony/stopwatch                     v2.7.4             Symfony Stopwatch Component
symfony/var-dumper                    v2.7.4             Symfony mechanism for exploring and du...
symfony/yaml                          v2.7.4             Symfony Yaml Component

Thanks

kinquestion

All 6 comments

Can you show the command you are running and the .phpcs file if you have any ?

Hi there!

Could you provide information how do you run the tool?
(eg cli command + content .php_cs file)

php-cs-fixer fix -vv I don't have .php_cs file (or a default maybe)

then you just need to provide dir you want to fix, like:
php-cs-fixer fix . -vv

.... Sorry for disturbing

Glad to be helpful!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vitek-rostislav picture vitek-rostislav  ·  3Comments

carusogabriel picture carusogabriel  ·  3Comments

teohhanhui picture teohhanhui  ·  3Comments

kcloze picture kcloze  ·  3Comments

aidantwoods picture aidantwoods  ·  3Comments