function ClassResolver::setContainer

Sets the service container.

Deprecated

in drupal:10.3.0 and is removed from drupal:11.0.0. Instead, you should pass the container as an argument in the __construct() method.

See also

https://www.drupal.org/node/3419963

File

core/lib/Drupal/Core/DependencyInjection/ClassResolver.php, line 65

Class

ClassResolver
Implements the class resolver interface supporting class names and services.

Namespace

Drupal\Core\DependencyInjection

Code

public function setContainer(?ContainerInterface $container) : void {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Instead, you should pass the container as an argument in the __construct() method. See https://www.drupal.org/node/3419963', E_USER_DEPRECATED);
    $this->container = $container;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.