yiisoft / di

PSR-11 compatible DI container and injector
https://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
183 stars 46 forks source link

Proposal to Add Reference::tag Method #333

Open nahakyuu opened 1 year ago

nahakyuu commented 1 year ago

I propose adding a new method, Reference::tag

// before
Reference::to('tag@translation.categorySource');
Reference::to('tag@' . Yiisoft\Log\Target::class);
// after
Reference::tag('translation.categorySource');
Reference::tag(Yiisoft\Log\Target::class);
xepozz commented 1 year ago

Would you like to implement?

vjik commented 1 year ago

Tags is Yii DI feature only. This proposal should be implemented in yiisoft/di.

vjik commented 1 year ago

Can we use one of exist class for implement suggested method or create new?

BoShurik commented 1 year ago

Maybe add a tag function which will use Reference::to('tag@'. $value);?