Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[RFC] [DependencyInjection] Automatically detect definitions class based on their factory #19161

Closed
@GuilhemN

Description

@GuilhemN

Thanks to the features of php 7.0 we can now guess the class of a service created with a factory:

function myFactory(): MyServiceClass
{
}

So I propose to create a new pass to automatically update the services definition when possible. This is particularly useful for autowiring (this way you don't have to copy-paste the class name of the service, especially when this is from a third party library).

What do you think ?

An implementation could be this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DependencyInjectionFeatureRFCRFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions