function UpdateCompilerPass::isArgumentMissingService

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Update/UpdateCompilerPass.php \Drupal\Core\Update\UpdateCompilerPass::isArgumentMissingService()
  2. 10 core/lib/Drupal/Core/Update/UpdateCompilerPass.php \Drupal\Core\Update\UpdateCompilerPass::isArgumentMissingService()
  3. 11.x core/lib/Drupal/Core/Update/UpdateCompilerPass.php \Drupal\Core\Update\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

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.