rectorphp / rector

Instant Upgrades and Automated Refactoring of any PHP 5.3+ code
https://getrector.com
MIT License
8.72k stars 686 forks source link

Issue updating to `v0.7.52` #3767

Closed u01jmg3 closed 4 years ago

u01jmg3 commented 4 years ago

Bug Report

Subject Details
Rector version v0.7.52
Installed as composer dependency

Attempted to update Rector to v0.7.52 to try out my shiny new Rector PHP config but I am getting:

ERROR Look at "Rector\Core\Set\SetResolver::resolveSetFileInfoByName()" on line 44

Tried to go back to v0.7.48 which previously worked but now I get:

[ERROR] Call to undefined method Symplify\SetConfigResolver\ConfigResolver::resolveSetFromInputAndDirectory()

Rector is now broken for me 😢

TomasVotruba commented 4 years ago

Thanks for moving it here :+1:


Could you verify if there is a change in 0.7.53?

u01jmg3 commented 4 years ago

🎉 working now but complains that the set laravel is missing. If you omit, Rector runs.

TomasVotruba commented 4 years ago

:+1:

There is no 'laravel` set, it was probably some magic config typo (that's why we shift from magic YAML to clear PHP :smile: ).

Better use specific sets from SetList class. See rector-ci.php:

https://github.com/rectorphp/rector/blob/91302f50af987ef94619341d0674d4c8b89d651f/rector-ci.php#L24-L33

u01jmg3 commented 4 years ago

https://github.com/rectorphp/rector/blob/master/docs/rector_rules_overview.md#laravel?

TomasVotruba commented 4 years ago

That's a category name for documentation, not a set.

Not all rule belongs to specific set, e.g. RenameClassRector. It's generic and can be used in many sets. But it belongs to category/package of Renaming

u01jmg3 commented 4 years ago

Ah - I misinterpreted the docs. I see it is versioned which makes sense so laravel54.

it was probably some magic config typo (that's why we shift from magic YAML to clear PHP)

Glad this is now a thing of the past!