Yii Framework Forum

Why `AbstractContainer::configure()` is used outside of container


#1

https://github.com/search?q=org%3Ayiisoft+"AbstractContainer"+"configure"&type=Code

Why AbstractContainer::configure() is used in so many places? It not only creates direct dependency on DI package, but also introduces surprising and tricky behavior - AbstractContainer::configure() supports calling methods via config array. Maybe it’s just me, but I would not expect such behavior when using $config and it may lead to overusing this feature and potentially create security issues.


(Alexander Makarov) #2

That is correct. Will be removed before release.


(Fabrizio Caldarelli) #3

Agree with plain config array with scalar or string values.

But for array that contain references descendant object config is essential.