diff --git a/Classes/ViewHelpers/ExplodeListViewHelper.php b/Classes/ViewHelpers/ExplodeListViewHelper.php index b3aff34..30aa797 100644 --- a/Classes/ViewHelpers/ExplodeListViewHelper.php +++ b/Classes/ViewHelpers/ExplodeListViewHelper.php @@ -24,18 +24,11 @@ */ class ExplodeListViewHelper extends AbstractViewHelper { - use CompileWithContentArgumentAndRenderStatic; - /** * Default split char, used as fallback. */ const DEFAULT_SPLIT_CHAR = ','; - /** - * Initialize arguments. - * - * @api - */ public function initializeArguments(): void { parent::initializeArguments(); @@ -60,20 +53,14 @@ public function initializeArguments(): void ); } - /** - * @param array $arguments - * @param \Closure $renderChildrenClosure - * @param RenderingContextInterface $renderingContext - * @return array - */ - public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): array + public function render() { - if ($arguments['splitNL'] !== false) { + if (($this->arguments['splitNL'] ?? false) !== false) { $splitChar = PHP_EOL; } else { - $splitChar = $arguments['splitChar'] ?? self::DEFAULT_SPLIT_CHAR; + $splitChar = $this->arguments['splitChar'] ?? self::DEFAULT_SPLIT_CHAR; } - $value = $arguments['value'] ?? $renderChildrenClosure(); + $value = $this->arguments['value'] ?? $renderChildrenClosure(); return explode($splitChar, (string)$value); } } diff --git a/Classes/ViewHelpers/GetDatabaseRecordViewHelper.php b/Classes/ViewHelpers/GetDatabaseRecordViewHelper.php index 8b60b38..acca642 100644 --- a/Classes/ViewHelpers/GetDatabaseRecordViewHelper.php +++ b/Classes/ViewHelpers/GetDatabaseRecordViewHelper.php @@ -30,19 +30,12 @@ */ class GetDatabaseRecordViewHelper extends AbstractViewHelper { - use CompileWithContentArgumentAndRenderStatic; - /** * Defaults */ const DEFAULT_TABLE = 'tt_content'; const DEFAULT_SPLIT_CHAR = ','; - /** - * Initialize arguments. - * - * @api - */ public function initializeArguments(): void { parent::initializeArguments(); @@ -66,18 +59,12 @@ public function initializeArguments(): void ); } - /** - * @param array $arguments - * @param \Closure $renderChildrenClosure - * @param RenderingContextInterface $renderingContext - * @return array - */ - public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): array + public function render(): array { - $table = $arguments['table'] ?? self::DEFAULT_TABLE; + $table = $this->arguments['table'] ?? self::DEFAULT_TABLE; $queryBuilder = self::getQueryBuilder($table); - $splitChar = $arguments['splitChar'] ?? self::DEFAULT_SPLIT_CHAR; - $uids = GeneralUtility::intExplode($splitChar, (string)$arguments['uidList'], true); + $splitChar = $this->arguments['splitChar'] ?? self::DEFAULT_SPLIT_CHAR; + $uids = GeneralUtility::intExplode($splitChar, (string)($this->arguments['uidList'] ?? ''), true); if ($uids === []) { return []; } diff --git a/Classes/ViewHelpers/RenderBodytextViewHelper.php b/Classes/ViewHelpers/RenderBodytextViewHelper.php index 04030ce..25301e6 100644 --- a/Classes/ViewHelpers/RenderBodytextViewHelper.php +++ b/Classes/ViewHelpers/RenderBodytextViewHelper.php @@ -24,22 +24,14 @@ * View helper to process bodytext field values for backend preview, similar to PageLayoutView:renderText(). */ class RenderBodytextViewHelper extends AbstractViewHelper -{ - use CompileWithContentArgumentAndRenderStatic; - - /** +{/** * Default crop value, used as fallback. */ const DEFAULT_CROP_VALUE = 1500; const DEFAULT_KEEP_TAGS_LIST = ['ol', 'ul', 'li']; - /** - * Initialize arguments. - * - * @api - */ - public function initializeArguments() + public function initializeArguments(): void { parent::initializeArguments(); $this->registerArgument( @@ -61,21 +53,15 @@ public function initializeArguments() ); } - /** - * @param array $arguments - * @param \Closure $renderChildrenClosure - * @param RenderingContextInterface $renderingContext - * @return string - */ - public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) + public function render() { - if ($arguments['crop'] === 0) { + if (($this->arguments['crop'] ?? 0) === 0) { $crop = 0; } else { - $crop = $arguments['crop'] ?: self::DEFAULT_CROP_VALUE; + $crop = $this->arguments['crop'] ?: self::DEFAULT_CROP_VALUE; } - $value = $arguments['value']; - $keepTags = $arguments['keepTags'] ? explode(',', str_replace(' ', '', $arguments['keepTags'])): self::DEFAULT_KEEP_TAGS_LIST; + $value = $this->arguments['value']; + $keepTags = $this->arguments['keepTags'] ? explode(',', str_replace(' ', '', $this->arguments['keepTags'])): self::DEFAULT_KEEP_TAGS_LIST; if ($value === null) { $value = $renderChildrenClosure(); } diff --git a/composer.json b/composer.json index cfecfbd..a3b0a42 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "require": { "php": "^7.4 || ~8.0", - "typo3/cms-core": "^10.4 || ^11.5 || ^12.1 || ^13.0" + "typo3/cms-core": "^10.4 || ^11.5 || ^12.1 || ^13.0 || ^14.0" }, "suggest": { "b13/listelements": "*" diff --git a/ext_emconf.php b/ext_emconf.php index d3cc480..043e5bd 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -12,7 +12,7 @@ 'version' => '1.4.3', 'constraints' => [ 'depends' => [ - 'typo3' => '10.4.0-13.99.99', + 'typo3' => '10.4.0-14.99.99', ], ], ];