Skip to content

Commit

Permalink
chore: migrate node identifier view helpers from renderStatic() to re…
Browse files Browse the repository at this point in the history
…nder()

This avoids deprecations in Fluid 4.
  • Loading branch information
brotkrueml committed Sep 19, 2024
1 parent 6f4c7fc commit deea616
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
11 changes: 2 additions & 9 deletions Classes/ViewHelpers/BlankNodeIdentifierViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Brotkrueml\Schema\ViewHelpers;

use Brotkrueml\Schema\Core\Model\BlankNodeIdentifier;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;

/**
Expand All @@ -32,14 +31,8 @@
*/
final class BlankNodeIdentifierViewHelper extends AbstractViewHelper
{
/**
* @param array{} $arguments
*/
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext,
): BlankNodeIdentifier {
public function render(): BlankNodeIdentifier
{
return new BlankNodeIdentifier();
}
}
10 changes: 3 additions & 7 deletions Classes/ViewHelpers/NodeIdentifierViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Brotkrueml\Schema\ViewHelpers;

use Brotkrueml\Schema\Core\Model\NodeIdentifier;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;

/**
Expand All @@ -38,11 +37,8 @@ public function initializeArguments(): void
$this->registerArgument('id', 'string', 'The identifier for the node', true);
}

public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext,
): NodeIdentifier {
return new NodeIdentifier($arguments['id']);
public function render(): NodeIdentifier
{
return new NodeIdentifier($this->arguments['id']);
}
}

0 comments on commit deea616

Please sign in to comment.