• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FluidTYPO3 / vhs / 28370493008

29 Jun 2026 12:01PM UTC coverage: 69.786% (+0.04%) from 69.744%
28370493008

push

github

NamelessCoder
[TASK] Define strict return types on nearly all ViewHelper public API

A few cases left behind since they require further refactoring.

21 of 25 new or added lines in 11 files covered. (84.0%)

4795 of 6871 relevant lines covered (69.79%)

4.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/Classes/ViewHelpers/Content/RenderViewHelper.php
1
<?php
2
namespace FluidTYPO3\Vhs\ViewHelpers\Content;
3

4
/*
5
 * This file is part of the FluidTYPO3/Vhs project under GPLv2 or later.
6
 *
7
 * For the full copyright and license information, please read the
8
 * LICENSE.md file that was distributed with this source code.
9
 */
10

11
use FluidTYPO3\Vhs\Traits\TemplateVariableViewHelperTrait;
12
use FluidTYPO3\Vhs\Utility\ContextUtility;
13

14
/**
15
 * ViewHelper used to render content elements in Fluid templates.
16
 *
17
 * ### Render a single content element by its UID
18
 *
19
 * Let's assume that the variable `settings.element.uid` contains the uid
20
 * of a content element.
21
 * It can be rendered as follows:
22
 *
23
 * ```
24
 * <v:content.render contentUids="{0: settings.element.uid}"/>
25
 * ```
26
 */
27
class RenderViewHelper extends AbstractContentViewHelper
28
{
29
    use TemplateVariableViewHelperTrait;
30

31
    public function initializeArguments(): void
32
    {
33
        parent::initializeArguments();
2✔
34
        $this->registerAsArgument();
2✔
35
    }
36

37
    public function render(): string|array|null
38
    {
39
        if (ContextUtility::isBackend()) {
2✔
40
            return '';
×
41
        }
42

43
        $content = $this->getContentRecords();
2✔
44
        if (!$this->hasArgument('as')) {
2✔
45
            return implode(LF, $content);
2✔
46
        }
47

48
        /** @var string|array|null $output */
NEW
49
        $output = $this->renderChildrenWithVariableOrReturnInput($content);
×
NEW
50
        return $output;
×
51
    }
52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc