[DependencyInjection] Make DefinitionErrorExceptionPass consider IGNORE_ON_UNINITIALIZED_REFERENCE and RUNTIME_EXCEPTION_ON_INVALID_REFERENCE the same#60423
Merged
fabpot merged 1 commit intosymfony:6.4from May 17, 2025
Conversation
Member
|
Would it make sense to say that if IGNORE_ON_UNINITIALIZED_REFERENCE is used, then RUNTIME_EXCEPTION_ON_INVALID_REFERENCE is implied? Would that fix the issue? |
Contributor
Author
|
Don’t know if it makes sense but it would also solve the issue yes. |
Member
|
It would to me yes! |
DefinitionErrorExceptionPass ignore the test containerDefinitionErrorExceptionPass consider IGNORE_ON_UNINITIALIZED_REFERENCE and RUNTIME_EXCEPTION_ON_INVALID_REFERENCE the same
Member
|
It'd be great to have the test case in the DI component instead. That'd solve the deps=low failure also. |
…GNORE_ON_UNINITIALIZED_REFERENCE` and `RUNTIME_EXCEPTION_ON_INVALID_REFERENCE` the same
Contributor
Author
|
Tests updated; failures are now unrelated! |
nicolas-grekas
approved these changes
May 17, 2025
fabpot
approved these changes
May 17, 2025
Member
|
Thank you @MatTheCat. |
This was referenced May 25, 2025
Merged
Merged
Merged
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test container can make runtime errors appear at compile-time: say you have a private definition referenced by a controller. Such a reference would be configured with
RUNTIME_EXCEPTION_ON_INVALID_REFERENCE, so if the private definition references an errored one, you’d get no exception at compile-time.Now, if this private definition is also referenced by the test container, it would be as
IGNORE_ON_UNINITIALIZED_REFERENCE. This would changeDefinitionErrorExceptionPass::isErrorForRuntime()result and trigger a compile-time exception.Following #60423 (comment), this PR makes the
DefinitionErrorExceptionPassconsiderIGNORE_ON_UNINITIALIZED_REFERENCEthe same way thanRUNTIME_EXCEPTION_ON_INVALID_REFERENCEto fix this issue.