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] Deprecate CompileWithRenderStatic and renderStatic() #990

Merged
merged 1 commit into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions Documentation/Changelog/2.x.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ Changelog 2.x
2.15
----

* Deprecation: Trait :php:`TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic`
has been marked as deprecated. It will log a deprecation level error message when called in
Fluid v4. It will be removed in Fluid v5.
* Deprecation: Trait :php:`TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderStatic`
has been marked as deprecated. It will log a deprecation level error message when called in
Fluid v4. It will be removed in Fluid v5.
* Deprecation: Static method :php:`renderStatic()` on ViewHelpers that don't use :php:`TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic`
or :php:`TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderStatic`
have been marked as deprecated. They will log a deprecation level error message when called in
Fluid v4. `renderStatic()` will no longer be called in Fluid v5.
* Deprecation: Variable names `true`, `false` and `null` will log a deprecation level error message because these
identifiers will become a Fluid language feature with v4.

Expand Down
4 changes: 4 additions & 0 deletions src/Core/ViewHelper/AbstractViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,10 @@ public function compile($argumentsName, $closureName, &$initializationPhpCode, V
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return mixed
* @deprecated renderStatic() on ViewHelpers will still be called in v4, but will log a
* deprecation level error message. It will no longer be called in v5.
* This concrete fallback implementation in AbstractViewHelper will be removed
* with v4.
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
* argument is specified and not empty.
*
* @deprecated Will be removed in v5. No longer necessary since getContentArgumentName() has been
* integrated into AbstractViewHelper with v2.15. Name has to be specified explicitly by overriding the
* method, implicit definition (= first optional argument) is no longer supported.
* integrated into AbstractViewHelper with v2.15. Name has to be specified explicitly
* by overriding the method, implicit definition (= first optional argument) is no
* longer supported.
*/
trait CompileWithContentArgumentAndRenderStatic
{
Expand Down
3 changes: 3 additions & 0 deletions src/Core/ViewHelper/Traits/CompileWithRenderStatic.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
* Provides default methods for rendering and compiling
* any ViewHelper that conforms to the `renderStatic`
* method pattern.
*
* @deprecated Will be removed in v5. The non-static render() method
* should be used instead
*/
trait CompileWithRenderStatic
{
Expand Down