di
di copied to clipboard
Add ability to set classes when resolving which an exception should be thrown
Goal: DTO and entities should not be resolved by container.
It can be implemented by using a callable. Will be good add option to disable this check.
Could be done with:
- Using annotations to mark each individual class.
- Using annotations to mark parent interface.
- Using a configuration to mark a namespace and its sub-namespaces.
Performance may drop because of these additional checks so:
- Benchmark is needed.
- If performace drop is significant, there should be an option to turn it off. It will likely be used in production.
Overall the idea looks like https://github.com/qossmic/deptrac but different.
It's better to have it as a static analyser extension imho
Yes, maybe.