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

FluidTYPO3 / vhs / 27842785131

19 Jun 2026 06:40PM UTC coverage: 70.695% (-0.005%) from 70.7%
27842785131

push

github

NamelessCoder
[TASK] Correct failing test expectations

5 of 7 new or added lines in 4 files covered. (71.43%)

215 existing lines in 10 files now uncovered.

5517 of 7804 relevant lines covered (70.69%)

14.92 hits per line

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

93.33
/Classes/ViewHelpers/Resource/FileViewHelper.php
1
<?php
2
namespace FluidTYPO3\Vhs\ViewHelpers\Resource;
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

13
/**
14
 * ViewHelper to output or assign FAL sys_file records.
15
 */
16
class FileViewHelper extends AbstractResourceViewHelper
17
{
18
    use TemplateVariableViewHelperTrait;
19

20
    public function initializeArguments(): void
21
    {
22
        parent::initializeArguments();
7✔
23
        $this->registerAsArgument();
7✔
24
        $this->registerArgument(
7✔
25
            'onlyProperties',
7✔
26
            'boolean',
7✔
27
            'Whether to return only the properties array of the sys_file record and not the File object itself',
7✔
28
            false,
7✔
29
            true
7✔
30
        );
7✔
31
    }
32

33
    public function render(): string
34
    {
35
        /** @var boolean $onlyProperties */
36
        $onlyProperties = $this->arguments['onlyProperties'];
7✔
37
        $files = (array) $this->getFiles($onlyProperties);
7✔
38
        if (1 === count($files)) {
7✔
UNCOV
39
            $files = array_shift($files);
×
40
        }
41
        // @TODO: figure out how to allow a ViewHelper to both render tags or return objects
42
        $output = $this->renderChildrenWithVariableOrReturnInput($files);
7✔
43
        return is_scalar($output) ? (string) $output : '';
7✔
44
    }
45
}
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