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

Breadcrumb

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

class DeprecatedServicePass

Sets the _deprecated_service_list parameter.

Hierarchy

  • class \Drupal\Core\DependencyInjection\Compiler\DeprecatedServicePass implements \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface

Expanded class hierarchy of DeprecatedServicePass

See also

\Drupal\Component\DependencyInjection\Container::get()

1 file declares its use of DeprecatedServicePass
CoreServiceProvider.php in core/lib/Drupal/Core/CoreServiceProvider.php

File

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

Namespace

Drupal\Core\DependencyInjection\Compiler
View source
class DeprecatedServicePass implements CompilerPassInterface {
    
    /**
     * {@inheritdoc}
     */
    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);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
DeprecatedServicePass::process public function You can modify the container here before it is dumped to PHP code. Overrides CompilerPassInterface::process

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal