3.x has a very minimal BC break. But if you are not sure what are they, then you may feel the pain. I am trying to document most of them, incase I missed please edit and send a pull request.
I will try to eventually pushed to the main Aura.Di repo.
The way di container is instantiated has been changed from
<?php use Aura\Di\Container; use Aura\Di\Factory; use Aura\Di\ContainerBuilder; $di = new Container(new Factory); // or $container_builder = new ContainerBuilder(); $di = $container_builder->newInstance( array(), array(), $auto_resolve = false );
<?php use Aura\Di\ContainerBuilder; $container_builder = new ContainerBuilder(); // use the builder to create and configure a container // using an array of ContainerConfig classes $di = $container_builder->newConfiguredInstance([ 'Aura\Cli\_Config\Common', 'Aura\Router\_Config\Common', 'Aura\Web\_Config\Common', ]);
setter vs setters
$di->setter is now
$di->setters. Please note there is an additional
s in the end. https://github.com/auraphp/Aura.Di/issues/115.
Automatic locking of container once an object is created by container. So make sure everything is lazy call, else you will run something like Cannot modify container when locked.
Config vs ContainerConfig
Example taken from Radar
$di->params['Radar\Adr\Handler\RoutingHandler']['matcher'] = $di->lazyGetCall('radar/adr:router', 'getMatcher');
matcher assigned is taken from the RouterContainer
Create multiple instances of the class. You can read the docs