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

Breadcrumb

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

function DeprecatedServicePass::process

Overrides CompilerPassInterface::process

File

core/lib/Drupal/Core/DependencyInjection/Compiler/DeprecatedServicePass.php, line 18

Class

DeprecatedServicePass
Sets the _deprecated_service_list parameter.

Namespace

Drupal\Core\DependencyInjection\Compiler

Code

public function process(ContainerBuilder $container) : void {
    $deprecated_services = [];
    foreach ($container->getDefinitions() as $service_id => $definition) {
        if ($definition->isDeprecated()) {
            $deprecated_services[$service_id] = $definition->getDeprecation($service_id)['message'];
        }
    }
    foreach ($container->getAliases() as $service_id => $definition) {
        if ($definition->isDeprecated()) {
            $deprecated_services[$service_id] = $definition->getDeprecation($service_id)['message'];
        }
    }
    $container->setParameter('_deprecated_service_list', $deprecated_services);
}
RSS feed
Powered by Drupal