mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Remove deprecated getInstance()
This commit is contained in:
parent
4ac095c25b
commit
898dfd8943
|
@ -5,7 +5,8 @@ Poodinis Changelog
|
|||
* ADD @PostConstruct UDA for marking methods which should be called after a dependency is resolved and autowired.
|
||||
* ADD @PreDestroy UDA for marking methods which should be called when the container loses a dependency's registration. It is called when
|
||||
removeRegistration or clearAllRegistrations is called. It is also called when the container is destroyed.
|
||||
* FIX nullpointer exception in instance factory when debugging with poodinisVerbose
|
||||
* FIX nullpointer exception in instance factory when debugging with poodinisVerbose.
|
||||
* REMOVE previously deprecated getInstance().
|
||||
|
||||
**Version 7.0.1**
|
||||
* FIX codegeneration of constructor injection factories for constructors with dependencies from foreign modules,
|
||||
|
|
|
@ -437,18 +437,6 @@ synchronized class DependencyContainer {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a global singleton instance of a dependency container.
|
||||
* Deprecated: create new instance with new keyword or implement your own singleton factory (method)
|
||||
*/
|
||||
deprecated public static shared(DependencyContainer) getInstance() {
|
||||
static shared DependencyContainer instance;
|
||||
if (instance is null) {
|
||||
instance = new DependencyContainer();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply persistent registration options which will be used everytime register() is called.
|
||||
*/
|
||||
|
|
|
@ -53,13 +53,6 @@ version(unittest) {
|
|||
assertThrown!ResolveException(container.resolve!TestClass, "Resolving cleared type does not fail");
|
||||
}
|
||||
|
||||
// Test get singleton of container (DEPRECATED)
|
||||
unittest {
|
||||
auto instance1 = DependencyContainer.getInstance();
|
||||
auto instance2 = DependencyContainer.getInstance();
|
||||
assert(instance1 is instance2, "getInstance does not return the same instance");
|
||||
}
|
||||
|
||||
// Test resolve single instance for type
|
||||
unittest {
|
||||
auto container = new shared DependencyContainer();
|
||||
|
|
Loading…
Reference in a new issue