function ReverseContainer::__construct
Constructs a ReverseContainer object.
Parameters
\Drupal\Component\DependencyInjection\Container|\Symfony\Component\DependencyInjection\Container $serviceContainer: The service container.
File
- 
              core/
lib/ Drupal/ Component/ DependencyInjection/ ReverseContainer.php, line 35  
Class
- ReverseContainer
 - Retrieves service IDs from the container for public services.
 
Namespace
Drupal\Component\DependencyInjectionCode
public function __construct(private readonly Container|SymfonyContainer $serviceContainer) {
  $this->getServiceId = \Closure::bind(function ($service) : ?string {
    return array_search($service, $this->services, TRUE) ?: NULL;
  }, $serviceContainer, $serviceContainer);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.