thephpleague / container

Small but powerful dependency injection container

Home Page:http://container.thephpleague.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2.x->3.x upgrade guide

danepowell opened this issue · comments

It appears that the 3.x branch renames a lot of methods, consolidates the container class and interface, and makes a number of other BC-breaking architectural changes, but the existing changelog / release notes do not enumerate these BC-breaking changes.

It would be really nice to have an upgrade guide that details exactly what consuming projects need to do to upgrade from 2.x->3.x, i.e.:

  • The ContainerInterface no longer exists, use Container instead
  • DefinitionInterface::withArgument() was renamed to DefinitionInterface::addArgument(), use the new method names instead.
  • etc

I'm specifically trying to upgrade Robo's usage here and running into various issues: consolidation/robo#955

You are absolutely right with this, an upgrade guide is definitely needed, it doesn't make me hate having to do it any less though haha.

I'll try and get something in place over the next few days, if you have any specific questions I can help with in the meantime, feel free to contact me directly, email might be best for that.

If you're able to help, you can see my work in progress at consolidation/robo#955

Let me know if there's something obvious I'm doing wrong there, or what could explain the Travis CI errors:

No container implementation has been set

Hey, I was relying on passing arguments on the get() method in v2. Is there a similar feature still available in v3 without having to define another dependency in the container?

@nebulousGirl @danepowell sorry for the delay on this, would love some feedback on this https://github.com/thephpleague/container/blob/4.x/docs/4.x/upgrade-guide.md

@danepowell hopefully I'll have some time to help on the robo upgrade in the next couple of weeks

Thanks! I didn't realize we were up to 4.x now 😮 Robo already upgraded to 3.x in consolidation/robo#985, I'm not sure if they need to upgrade to 4.x as well. If so I'll review the guide and help where I can.

I'm going to close this as the upgrade guide now just targets to latest but has section to upgrade FROM each major