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\CompilerCode
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 = [];
}
}