-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
ServicesExtension: locator support Statement #294
Conversation
I have for a long time in the TODO to simplify the multi-factory. To make it defined the same way as a classic generated factory. Maybe like this: services:
date.formats:
implements: h4kuna\Format\Date\FormatsAccessor
contains:
date: h4kuna\Format\Date\Formatters\DateTimeFormatter('j.n.Y')
time: h4kuna\Format\Date\Formatters\DateTimeFormatter('H:i:s') Compared to the syntax with parentheses, the advantage is that you can easily add, for example, contains:
date: h4kuna\Format\Date\Formatters\DateTimeFormatter('j.n.Y')
time:
factory: h4kuna\Format\Date\Formatters\DateTimeFormatter('H:i:s')
setup:
- foo |
For my use case, the my way is sufficient. I would like this option to be possible. For me is important that the services are I understand correctly that you are looking for a keyword for a key Your second example is standard what I would expect to work. But i don't need in this moment. |
9062d04
to
cd3f6d4
Compare
0982df1
to
710c346
Compare
680bc12
to
5066242
Compare
b109822
to
7f11e6e
Compare
ef39d2d
to
f729b1e
Compare
5726063
to
9e58785
Compare
Example
In example I used classes from my library, if you want to try, let's use
composer require h4kuna/number-format:dev-mater
, but i think it is not necessary.I want to define custom collection of formats
The original way is too chatty, the patch allow
I don't need class with option
autowired: true
explicitly to register to container. But behavior is same like above.What do you think?