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

Wildcards in rules #185

Closed
vaclavgreif opened this issue Jun 21, 2020 · 3 comments
Closed

Wildcards in rules #185

vaclavgreif opened this issue Jun 21, 2020 · 3 comments

Comments

@vaclavgreif
Copy link

Is it possible to use wildcards in the rules? Ie., I would like to have all classes under a specific namespace (ie. MyApp\Managers) shared, without having to explicitely define every single class in the config.

Is this possible somehow?

@vaclavgreif
Copy link
Author

Any idea on this one please?

@TRPB
Copy link
Member

TRPB commented Sep 3, 2020

At the moment, it's not possible to do this and the performance overhead would be quite large as every single time an instance is created/retrieved it would need to find the rule in a wildcard manner.

If the majority of your classes are shared, you can set shared as the default rule and then set shared to false for the ones that are not.

@vaclavgreif
Copy link
Author

Thanks, will do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants