Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/DependencyInjection/ContainerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ public static function postInitializeContainer(Container $container): void
// under. Clearing must be the LAST step: building the typeSpecifier service runs
// extension constructors that can already perform type operations, and entries
// memoized before the toggles are set would encode the previous container's state.
//
// This is also the only invalidation the process needs, because it is the last step
// of create(): compiling the container runs ValidateIgnoredErrorsExtension, which
// swaps in a DummyReflectionProvider and a runtime PhpVersion to resolve the types
// named in the ignoreErrors patterns. Whatever that memoizes against the throwaway
// state (a DummyReflectionProvider knows no class hierarchy, so e.g.
// union(Exception, RuntimeException) does not collapse under it) is dropped here,
// before the container reaches anything that analyses code. Keep it that way — do
// not clear the memo from the mutators of that state instead: registerInstance() on
// either accessor runs above, before the toggles are set, so a clear there would run
// too early to be the guard while looking like one.
TypeCombinator::clearCache();
}

Expand Down
Loading