Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Throw an exception if a ContainerBuilder is modified *after* building the container #421
The goal is to detect errors sooner when users will do something like this:
$containerBuilder->addDefinitions(...); $container = $containerBuilder->build(); $containerBuilder->addDefinitions([ 'foo' => 'bar', ]); $container->get('foo'); // Exception
Definitions (or anything actually) added after the container was created is ignored, but it sometimes can be not obvious.
By "locking" the builder after the container is created (throwing an exception on all modifications) could help.