Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8007d7a

Browse filesBrowse 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
Copy full SHA for 8007d7a

File tree

Expand file treeCollapse file tree

2 files changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-1
lines changed

‎Compiler/DefinitionErrorExceptionPass.php

Copy file name to clipboardExpand all lines: Compiler/DefinitionErrorExceptionPass.php
+4-1Lines 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

Copy file name to clipboardExpand all lines: Tests/Compiler/DefinitionErrorExceptionPassTest.php
+3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.