Commit 334bd4f
committed
bug symfony#60423 [DependencyInjection] Make
This PR was merged into the 6.4 branch.
Discussion
----------
[DependencyInjection] Make `DefinitionErrorExceptionPass` consider `IGNORE_ON_UNINITIALIZED_REFERENCE` and `RUNTIME_EXCEPTION_ON_INVALID_REFERENCE` the same
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix symfony#54570
| License | MIT
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 change `DefinitionErrorExceptionPass::isErrorForRuntime()` result and trigger a compile-time exception.
Following symfony#60423 (comment), this PR makes the `DefinitionErrorExceptionPass` consider `IGNORE_ON_UNINITIALIZED_REFERENCE` the same way than `RUNTIME_EXCEPTION_ON_INVALID_REFERENCE` to fix this issue.
Commits
-------
72171c0 [DependencyInjection] Make `DefinitionErrorExceptionPass` consider `IGNORE_ON_UNINITIALIZED_REFERENCE` and `RUNTIME_EXCEPTION_ON_INVALID_REFERENCE` the sameDefinitionErrorExceptionPass consider IGNORE_ON_UNINITIALIZED_REFERENCE and RUNTIME_EXCEPTION_ON_INVALID_REFERENCE the same (MatTheCat)File tree
2 files changed
+7
-1
lines changed- src/Symfony/Component/DependencyInjection
- Compiler
- Tests/Compiler
2 files changed
+7
-1
lines changedLines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
0 commit comments