Skip to content

Commit

Permalink
Drop deprecated renderStatic
Browse files Browse the repository at this point in the history
  • Loading branch information
stephankellermayr committed Nov 6, 2024
1 parent 300c230 commit 5e30902
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions Classes/ViewHelpers/IconViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@
*/
class IconViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;

protected $escapeOutput = false;

public function initializeArguments()
public function initializeArguments(): void
{
$this->registerArgument('iconfig', 'string', 'The rendering configuration of the requested icon', true);
$this->registerArgument('additionalAttributes', 'array', 'Additional attributes', false);
Expand All @@ -41,23 +40,17 @@ public function initializeArguments()
/**
* Render the header icon.
*
* @param array $arguments
* @param Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
*/
public static function renderStatic(
array $arguments,
Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
): string {
public function render(): string
{
/** @var IconpackFactory $iconpackFactory */
$iconpackFactory = GeneralUtility::makeInstance(IconpackFactory::class);
return $iconpackFactory->getIconMarkup(
$arguments['iconfig'],
$this->arguments['iconfig'],
'native',
$arguments['additionalAttributes'],
$arguments['preferredRenderTypes']
$this->arguments['additionalAttributes'],
$this->arguments['preferredRenderTypes']
) ?? '';
}
}

0 comments on commit 5e30902

Please sign in to comment.