Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Remove constructor from variable provider interface #829

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

s2b
Copy link
Contributor

@s2b s2b commented Nov 21, 2023

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:

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
@lolli42 lolli42 merged commit c18f300 into main Nov 21, 2023
4 checks passed
@lolli42 lolli42 deleted the task/removeInterfaceConstructor branch November 21, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants