[TASK] Remove constructor from variable provider interface #829
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.
Currently, the VariableProviderInterface suggests that its implementations can receive an array of variables as a constructor argument to be used as initial state of the provider instance. However, this assumption is already not correct anymore because ChainedVariableProvider receives an array of VariableProvider instances instead. In addition, this restricts possible other implementations of the interface.
Noteworthy in the code and relevant projects using Fluid:
Neos implements its own VariableProvider which extends StandardVariableProvider. The change has no effect there. https://github.com/neos/fluidadaptor/blob/8.3/Classes/Core/ViewHelper/TemplateVariableContainer.php
Fluid uses the constructor mostly with concrete implementations (mostly StandardVariableProvider, but also ChainedVariableProvider).
ConsoleRunner uses a dynamic class name, but no constructor arguments. https://github.com/TYPO3/Fluid/blob/main/src/Tools/ConsoleRunner.php#L116C68-L116C68
flux, vhs and fluid-parameters only use StandardVariableProvider
Fluid Components and Fluid Styleguide only use StandardVariableProvider