Skip to content

Support #[AutowireLocator] #411

Open
@mvhirsch

Description

@mvhirsch

Symfony 6.4 introduced an attribute called #[AutowireLocator] which automatically creates and injects a ServiceLocator into a service. Looks like a similar feature was already implemented with #151.

Is it possible to add support for this feature, too?

final class TranscriptAdmin
{
   // ...

    #[Required]
    public function setContainer(
        #[AutowireLocator([ProfileRepository::class])] ContainerInterface $container
    ): void {
        $this->locator = $container;
    }
}
 ------ ---------------------------------------------------------------------- 
  Line   src/TranscriptBundle/Admin/TranscriptAdmin.php                        
 ------ ---------------------------------------------------------------------- 
  56     Service "App\ProfileBundle\Repository\ProfileRepository" is private.  
         ✏️  src/TranscriptBundle/Admin/TranscriptAdmin.php                    
 ------ ---------------------------------------------------------------------- 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions