[TASK] Make Configuration default for ConfigurationInterface
#466
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.
It's a good practice to define interfaces and provide a default
implementation making xclass strategies, stubbing or mocking in
tests and similar techniques easier. Default implementation, if
provided, should be configured in the DI configuration as alias
for the interface, not done for the
ConfigurationInterfaceonthe default implementation
Configuration.TYPO3
SingeltonInterfacestems from old times before DI hasbeen introduced to TYPO3 and has been used to mark classes as
shared(only instanciated onces) withinGeneralUtilitiy,something is the default behaviour for services in DI as long
as not configured otherwise. Having
ConfigurationInterfaceand
ConfigurationDI aware makes theSingeltonInterfaceobsolete.
Services implementing
SingletonInterfaceare automaticallyconfigured as
public: trueby a TYPO3 DI compiler pass andneeds to be set manually when removing the interface from a
service.
This change ...
SingletonInterfacefromConfigurtionin favourof default
shared: trueof the DI.AsAliasphp attribute onConfigurationtomark it as the default
ConfigurationInterfaceservice,addtional setting the service as
public: trueto allowretrieval using
GeneralUtility::makeInstance().That prepares towards retrieving services by DI either as
constructor or
inject*methods in the future.