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

Breadcrumb

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

function UpdateCompilerPass::isArgumentMissingService

Checks if a reference argument is to a missing service.

Parameters

mixed $argument: The argument to check.

\Symfony\Component\DependencyInjection\ContainerBuilder $container: The container.

Return value

bool TRUE if the argument is a reference to a service that is missing from the container and the reference is required, FALSE if not.

1 call to UpdateCompilerPass::isArgumentMissingService()
UpdateCompilerPass::process in core/lib/Drupal/Core/Update/UpdateCompilerPass.php
You can modify the container here before it is dumped to PHP code.

File

core/lib/Drupal/Core/Update/UpdateCompilerPass.php, line 85

Class

UpdateCompilerPass
Removes services with unmet dependencies.

Namespace

Drupal\Core\Update

Code

private function isArgumentMissingService($argument, ContainerBuilder $container) {
    if ($argument instanceof Reference) {
        $argument_id = (string) $argument;
        if (!$container->has($argument_id) && $argument->getInvalidBehavior() === ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
            return TRUE;
        }
    }
    return FALSE;
}

API Navigation

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