cakephp / upgrade

Upgrade tools for CakePHP meant to facilitate migrating from one version of the framework to another
MIT License
110 stars 59 forks source link

More missing rectors #266

Open dereuromark opened 8 months ago

dereuromark commented 8 months ago

In test cases

protected $fixtures = [

should be

protected array $fixtures = [
LordSimal commented 8 months ago

This would require separate ruleset and adjusted docs since it needs to be applied to the tests folder, not the src folder

dereuromark commented 8 months ago

I dont think so. I always run the upgrade over all folders, src and tests. It will just ignore the ones that dont match.

LordSimal commented 8 months ago

Cool that you do it but at least in our docs we reference that these rules should only be applied to the src directory. https://book.cakephp.org/5/en/appendices/5-0-upgrade-guide.html

Also parsing unnecessary files in rector only increases the upgrade time so trying to apply rector rules in the tests folder which can never be applied seems like an obvious waste of ressources.

dereuromark commented 8 months ago

You misread that statement IMO The point is to use a folder inside ROOT, never ROOT Doing ROOT will explode your computer, but using src/, tests/, config/ or any other non root (thus non vendor) folder works out of the box super quick and easy, no problems.

So we can also just clarify the docs here further :)

LordSimal commented 8 months ago

Then the docs are 100% not clear, agreed

LordSimal commented 8 months ago

Could also be the fact that I never had something inside tests which would have automatically be fixed via the rector tool.... could also be how I write my tests... 😅

markstory commented 7 months ago

Should we detect that the provided path is a project root and do the right thing for users? If we can find a src/, tests/, config/ directories we could add those to the list instead of the provided directory. Might make using the upgrade tool simpler to operate. I've bumped into this in the past as well.

dereuromark commented 6 months ago

Also:

dereuromark commented 6 months ago

Also tried adding

new ModalToGetSet('Cake\ORM\Entity', 'source'),

into 3.4 set

but it didnt seem to work. The source() method is on the trait.. maybe thats the issue.