cspray / annotated-container

Dependency Injection framework to configure a PSR-11 Container with Attributes!
MIT License
38 stars 1 forks source link

Allow a service delegate to create a named service #326

Open cspray opened 1 year ago

cspray commented 1 year ago

Right now the #[ServiceDelegate] Attribute can only be used to create explicit object types. However, we should be able to use this pattern to create any value that might be put into a service; including callables, strings, and other scalar types. If we allow a service to be defined by name and then allow a factory to create that named service it should be able to provide functionality for non-object container values.

cspray commented 2 months ago

Need to research whether this is actually an issue. I believe this should be supported now.