Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AutowireServiceClosure.php

function AutowireServiceClosure::__construct

Parameters

string $service The service id to wrap in the closure:

Overrides Autowire::__construct

File

vendor/symfony/dependency-injection/Attribute/AutowireServiceClosure.php, line 26

Class

AutowireServiceClosure
Attribute to wrap a service in a closure that returns it.

Namespace

Symfony\Component\DependencyInjection\Attribute

Code

public function __construct(string $service) {
    parent::__construct(new ServiceClosureArgument(new Reference($service)));
}
RSS feed
Powered by Drupal