[TASK] Refactor ConfigurationManager#4558
[TASK] Refactor ConfigurationManager#4558sfroemkenjw wants to merge 1 commit intoTYPO3-Solr:mainfrom
Conversation
sfroemkenjw
commented
Mar 5, 2026
- Add dependency injection for SiteFinder
- Cleanup methods for better readability & reuse
* Add dependency injection for SiteFinder * Cleanup methods for better readability & reuse
| * Configuration manager that holds the configuration instance. | ||
| */ | ||
| class ConfigurationManager implements SingletonInterface | ||
| readonly class ConfigurationManager implements SingletonInterface |
There was a problem hiding this comment.
you can register the ConfigurationManager class in the Services.yaml file, to auto configure, make it public + shared, then you can
- Remove the SingletonInterface
- make CPP and remove the
?? GeneralUtility::makeInstance(SiteFinder)
|
I think I might have been a bit too hasty with this PR. The ConfigurationManager is a very central part of the system, and I’ve run into some significant challenges during the refactoring. The main issue is that this class is frequently instantiated using GeneralUtility::makeInstance() without any parameters. Adding dependencies to the constructor causes breaks in numerous places, especially within our Unit Tests. When I try to inject classes like the SiteFinder or a FrontendInterface, these dependencies cannot be easily resolved in a Unit Test environment. Furthermore, some methods contain logic branches where one part is testable via Unit Tests, but the other part strictly requires a Functional Test approach due to its dependencies. This makes working on this specific file quite difficult at the moment. My plan now is to first migrate less critical classes from Unit to Functional tests, unless a Unit Test can truly isolate the class without recursive calls. Once the testing foundation is more robust, I will revisit this refactor. |