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

Breadcrumb

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

function DefinitionErrorExceptionPass::processValue

Overrides AbstractRecursivePass::processValue

File

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

Class

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

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

protected function processValue(mixed $value, bool $isRoot = false) : mixed {
    if ($value instanceof ArgumentInterface) {
        parent::processValue($value->getValues());
        return $value;
    }
    if ($value instanceof Reference && $this->currentId !== ($targetId = (string) $value)) {
        if (ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE === $value->getInvalidBehavior()) {
            $this->sourceReferences[$targetId][$this->currentId] ??= true;
        }
        else {
            $this->sourceReferences[$targetId][$this->currentId] = false;
        }
        return $value;
    }
    if (!$value instanceof Definition || !$value->hasErrors() || $value->hasTag('container.error')) {
        return parent::processValue($value, $isRoot);
    }
    $this->erroredDefinitions[$this->currentId] = $value;
    return parent::processValue($value);
}
RSS feed
Powered by Drupal