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

FluidTYPO3 / flux / 15918415903

20 May 2025 10:36AM UTC coverage: 91.109% (-2.1%) from 93.21%
15918415903

push

github

NamelessCoder
[TASK] Lock phpstan version

6927 of 7603 relevant lines covered (91.11%)

9.53 hits per line

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

85.71
/Classes/ViewHelpers/Form/VariableViewHelper.php
1
<?php
2
declare(strict_types=1);
3
namespace FluidTYPO3\Flux\ViewHelpers\Form;
4

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

12
use FluidTYPO3\Flux\ViewHelpers\AbstractFormViewHelper;
13
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
14

15
/**
16
 * Sets an option in the Form instance
17
 */
18
class VariableViewHelper extends AbstractFormViewHelper
19
{
20
    public function initializeArguments(): void
21
    {
22
        $this->registerArgument('value', 'mixed', 'Value of the option');
1✔
23
        $this->registerArgument(
1✔
24
            'name',
1✔
25
            'string',
1✔
26
            'Name of the option - valid values and their behaviours depend entirely on the consumer that will ' .
1✔
27
            'handle the Form instance',
1✔
28
            true
1✔
29
        );
1✔
30
    }
31

32
    public function render()
33
    {
34
        return self::renderStatic($this->arguments, $this->buildRenderChildrenClosure(), $this->renderingContext);
×
35
    }
36

37
    public static function renderStatic(
38
        array $arguments,
39
        \Closure $renderChildrenClosure,
40
        RenderingContextInterface $renderingContext
41
    ): string {
42
        /** @var string $variableName */
43
        $variableName = $arguments['name'];
1✔
44
        static::getContainerFromRenderingContext($renderingContext)
1✔
45
            ->setVariable($variableName, $arguments['value'] ?? $renderChildrenClosure());
1✔
46
        return '';
1✔
47
    }
48

49
    public function getContentArgumentName(): ?string
50
    {
51
        return 'value';
×
52
    }
53
}
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