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

Breadcrumb

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

function DefinitionErrorExceptionPass::process

Overrides AbstractRecursivePass::process

File

vendor/symfony/dependency-injection/Compiler/DefinitionErrorExceptionPass.php, line 33

Class

DefinitionErrorExceptionPass
Throws an exception for any Definitions that have errors and still exist.

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

public function process(ContainerBuilder $container) : void {
    try {
        parent::process($container);
        $visitedIds = [];
        foreach ($this->erroredDefinitions as $id => $definition) {
            if ($this->isErrorForRuntime($id, $visitedIds)) {
                continue;
            }
            // only show the first error so the user can focus on it
            $errors = $definition->getErrors();
            throw new RuntimeException(reset($errors));
        }
    } finally {
        $this->erroredDefinitions = [];
        $this->sourceReferences = [];
    }
}
RSS feed
Powered by Drupal