DeprecatedServicePass.php in Drupal 10
File
core/lib/Drupal/Core/DependencyInjection/Compiler/DeprecatedServicePass.php
View source
<?php
namespace Drupal\Core\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class DeprecatedServicePass implements CompilerPassInterface {
public function process(ContainerBuilder $container) {
$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);
}
}