ServicesExtension: locator support Statement#294
Merged
dg merged 1 commit intonette:masterfrom Feb 5, 2024
h4kuna:reference-autobuild
Merged
ServicesExtension: locator support Statement#294dg merged 1 commit intonette:masterfrom h4kuna:reference-autobuild
dg merged 1 commit intonette:masterfrom
h4kuna:reference-autobuild
Conversation
Member
|
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 |
Contributor
Author
|
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
dg
pushed a commit
that referenced
this pull request
Feb 5, 2024
dg
pushed a commit
that referenced
this pull request
Feb 6, 2024
dg
pushed a commit
that referenced
this pull request
Feb 6, 2024
dg
pushed a commit
that referenced
this pull request
Feb 6, 2024
dg
pushed a commit
that referenced
this pull request
Feb 6, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: trueexplicitly to register to container. But behavior is same like above.What do you think?