rector: "config/set/code-quality.php" was not found (and all others too)

Bug Report

Subject Details
rector/rector-prefixed v0.8.7@869441e
Installed as prefixed Rector PHAR

Good morning

Since days, I can’t use anymore my preferred static analysis quality tool because for an unknown reason my rector.php file can’t be processed correctly. Rector is saying that my list of SETS are no more correct.

This is my command:

vendor\bin\rector.bat process --dry-run --config C:\Christophe\.config\rector.php C:\Christophe\src\classes\WebService.php

And I get immediately:

[ERROR] Set
         "phar://C:/Users/Christophe/AppData/Roaming/Composer/vendor/rector/rector-prefixed/rector/packages/se
         t/src/ValueObject/../../../../config/set/code-quality.php" was not found

 ! [NOTE] Pick one of:

 * defluent
 * action-injection-to-constructor-injection
 * array-str-functions-to-static-call
 * cakephp30
 * cakephp34
 * cakephp35
 * cakephp36
 * ...

To make sure I’ve copied/pasted the rector.php sample given in your readme.md file (on the repo page) and still the same problem.

Minimal PHP Code Causing Issue

This isn’t a problem with my .php source but with the config file but, in case, here is my rector config: https://getrector.org/demo/dbb6b91d-7d80-4883-b547-405505c62217#result

Expected Behaviour

Rector need to retrieve the list of rules that are part of the provided Options::SETS array.

Many thanks!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Closing as last issue is dupplicate of https://github.com/rectorphp/rector/issues/4736

The Rector scooping will be handled in completely different way in Rector 0.9

This issue will be solved soon with un-pharred package scoping - see https://github.com/symplify/package-scoper

ECS and MonorepoBuilder already use this technique, and it’s way better with debugging and paths

Could you try to download Rector via composer dependency and tune this part https://github.com/symplify/set-config-resolver/blob/28d6a4174da548e7b73ead8be349e6908a0f2eb9/src/Provider/AbstractSetProvider.php#L62 to to make it work?

Then we’d have a fix 😃