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

CPS-IT / handlebars-forms / 23530930037

25 Mar 2026 08:00AM UTC coverage: 0.778% (-0.009%) from 0.787%
23530930037

push

github

eliashaeussler
[TASK] Use and apply PHPStan strict and deprecation rules

0 of 4 new or added lines in 2 files covered. (0.0%)

17 existing lines in 1 file now uncovered.

7 of 900 relevant lines covered (0.78%)

0.03 hits per line

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

0.0
/Classes/Fluid/ViewHelperInvoker.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the TYPO3 CMS extension "handlebars_forms".
7
 *
8
 * It is free software; you can redistribute it and/or modify it under
9
 * the terms of the GNU General Public License, either version 2
10
 * of the License, or any later version.
11
 *
12
 * For the full copyright and license information, please read the
13
 * LICENSE.txt file that was distributed with this source code.
14
 *
15
 * The TYPO3 project - inspiring people to share!
16
 */
17

18
namespace CPSIT\Typo3HandlebarsForms\Fluid;
19

20
use TYPO3\CMS\Fluid;
21
use TYPO3\CMS\Form;
22
use TYPO3Fluid\Fluid as FluidStandalone;
23

24
/**
25
 * ViewHelperInvoker
26
 *
27
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
28
 * @license GPL-2.0-or-later
29
 */
30
final readonly class ViewHelperInvoker
31
{
32
    /**
33
     * @param class-string<FluidStandalone\Core\ViewHelper\ViewHelperInterface> $viewHelperClassName
34
     * @param array<string, mixed> $arguments
35
     * @param (\Closure(FluidStandalone\Core\ViewHelper\TagBuilder): mixed)|null $closure
36
     */
37
    public function invoke(
×
38
        Fluid\Core\Rendering\RenderingContext $renderingContext,
39
        string $viewHelperClassName,
40
        array $arguments = [],
41
        ?\Closure $closure = null,
42
    ): ViewHelperInvocationResult {
43
        $tag = new FluidStandalone\Core\ViewHelper\TagBuilder();
×
44
        $viewHelper = $renderingContext->getViewHelperResolver()->createViewHelperInstanceFromClassName($viewHelperClassName);
×
45

46
        if ($viewHelper instanceof FluidStandalone\Core\ViewHelper\AbstractTagBasedViewHelper) {
×
47
            $viewHelper->setTagBuilder($tag);
×
48
        }
49

NEW
50
        $closure ??= static fn() => '';
×
51
        $content = $renderingContext->getViewHelperInvoker()->invoke(
×
52
            $viewHelper,
×
53
            $arguments,
×
54
            $renderingContext,
×
NEW
55
            static fn() => $closure($tag),
×
56
        );
×
57

58
        return new ViewHelperInvocationResult($viewHelper, $renderingContext, $content, $tag);
×
59
    }
60

61
    /**
62
     * @param string|list<string|int> $property
63
     * @param 'property'|'renderingOptionProperty' $propertyArgumentName
64
     */
65
    public function translateElementProperty(
×
66
        Fluid\Core\Rendering\RenderingContext $renderingContext,
67
        Form\Domain\Model\Renderable\RootRenderableInterface $renderable,
68
        string|array $property,
69
        string $propertyArgumentName = 'property',
70
    ): mixed {
71
        $result = $this->invoke(
×
72
            $renderingContext,
×
73
            Form\ViewHelpers\TranslateElementPropertyViewHelper::class,
×
74
            [
×
75
                'element' => $renderable,
×
76
                $propertyArgumentName => $property,
×
77
            ],
×
78
        );
×
79

80
        return $result->content;
×
81
    }
82
}
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