Skip to content

Commit 8007d7a

Browse files
Merge branch '6.4' into 7.2
* 6.4: [Validator] Review Croatian translation [Validator] Review "twig template" translation Provide missing translations thanks to Gemini [DependencyInjection] Make `DefinitionErrorExceptionPass` consider `IGNORE_ON_UNINITIALIZED_REFERENCE` and `RUNTIME_EXCEPTION_ON_INVALID_REFERENCE` the same [WebLink] Hint that prerender is deprecated
2 parents 42cb5ab + 8cb11f8 commit 8007d7a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Compiler/DefinitionErrorExceptionPass.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ protected function processValue(mixed $value, bool $isRoot = false): mixed
6262
}
6363

6464
if ($value instanceof Reference && $this->currentId !== $targetId = (string) $value) {
65-
if (ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE === $value->getInvalidBehavior()) {
65+
if (
66+
ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE === $value->getInvalidBehavior()
67+
|| ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $value->getInvalidBehavior()
68+
) {
6669
$this->sourceReferences[$targetId][$this->currentId] ??= true;
6770
} else {
6871
$this->sourceReferences[$targetId][$this->currentId] = false;

Tests/Compiler/DefinitionErrorExceptionPassTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public function testSkipNestedErrors()
6464
$container->register('foo', 'stdClass')
6565
->addArgument(new Reference('bar', ContainerBuilder::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE));
6666

67+
$container->register('baz', 'stdClass')
68+
->addArgument(new Reference('bar', ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE));
69+
6770
$pass = new DefinitionErrorExceptionPass();
6871
$pass->process($container);
6972

0 commit comments

Comments
 (0)