public function DeprecatedServicePass::process in Drupal 9
File
- core/
lib/ Drupal/ Core/ DependencyInjection/ Compiler/ DeprecatedServicePass.php, line 18
Class
- DeprecatedServicePass
- Sets the _deprecated_service_list parameter.
Namespace
Drupal\Core\DependencyInjection\CompilerCode
public function process(ContainerBuilder $container) {
$deprecated_services = [];
foreach ($container
->getDefinitions() as $service_id => $definition) {
if ($definition
->isDeprecated()) {
$deprecated_services[$service_id] = $definition
->getDeprecationMessage($service_id);
}
}
foreach ($container
->getAliases() as $service_id => $definition) {
if ($definition
->isDeprecated()) {
$deprecated_services[$service_id] = $definition
->getDeprecationMessage($service_id);
}
}
$container
->setParameter('_deprecated_service_list', $deprecated_services);
}