Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use namespaces to avoid class name conflicts #63

Merged
merged 2 commits into from
Sep 30, 2020

Conversation

lcobucci
Copy link
Owner

@lcobucci lcobucci commented Sep 30, 2020

Allowing for applications to build multiple containers using configurations and namespaces.

This breaks BC for making it mandatory and for changing the way the dump directory is used.

Upgrading

Specify a namespace when creating the container builder. Tip: Make sure your config file is namespaced and use __NAMESPACE__ to create the builder:

declare(strict_types=1);

namespace Me\MyApplication\Config;

use Lcobucci\DependencyInjection\ContainerBuilder;

require __DIR__ . '/../vendor/autoload.php';

// $builder = new ContainerBuilder(); // v5.x initialisation
// $builder = ContainerBuilder::default(__FILE__); // v6.x initialisation
$builder = ContainerBuilder::default(__FILE__, __NAMESPACE__);

Allowing for applications to build multiple containers using different
configurations and namespaces.

This breaks BC for making it mandatory and for changing the way the dump
directory is used.
@lcobucci lcobucci added this to the 7.0.0 milestone Sep 30, 2020
@lcobucci lcobucci self-assigned this Sep 30, 2020
@lcobucci lcobucci merged commit 66099d0 into 7.0.x Sep 30, 2020
@lcobucci lcobucci deleted the isolate-containers-with-namespaces branch September 30, 2020 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant