isArgumentMissingService example

public function process(ContainerBuilder $container) {
    $process_aliases = FALSE;
    // Loop over the defined services and remove any with unmet dependencies.     // The kernel cannot be booted if the container has such services. This     // allows modules to run their update hooks to enable newly added     // dependencies.     do {
      $has_changed = FALSE;
      foreach ($container->getDefinitions() as $key => $definition) {
        // Ensure all the definition's arguments are valid.         foreach ($definition->getArguments() as $argument) {
          if ($this->isArgumentMissingService($argument$container)) {
            $container->removeDefinition($key);
            $container->log($thissprintf('Removed service "%s"; reason: depends on non-existent service "%s".', $key(string) $argument));
            $has_changed = TRUE;
            $process_aliases = TRUE;
            // Process the next definition.             continue 2;
          }
        }

        // Ensure all the method call arguments are valid.         foreach ($definition->getMethodCalls() as $call) {
          
Home | Imprint | This part of the site doesn't use cookies.