You are here

private function UpdateCompilerPass::isArgumentMissingService in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Update/UpdateCompilerPass.php \Drupal\Core\Update\UpdateCompilerPass::isArgumentMissingService()
  2. 9 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.

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