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

CPS-IT / handlebars-forms / 23536691368

25 Mar 2026 10:35AM UTC coverage: 0.756% (-0.002%) from 0.758%
23536691368

push

github

eliashaeussler
[FEATURE] Include `FormRuntime` in value resolution context

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

7 of 926 relevant lines covered (0.76%)

0.03 hits per line

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

0.0
/Classes/ContentObject/Context/ValueResolutionContext.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\ContentObject\Context;
19

20
use CPSIT\Typo3HandlebarsForms\Domain;
21
use TYPO3\CMS\Form;
22

23
/**
24
 * ValueResolutionContext
25
 *
26
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
27
 * @license GPL-2.0-or-later
28
 *
29
 * @phpstan-type ProcessorClosure \Closure(
30
 *     array<string|int, mixed>,
31
 *     Form\Domain\Model\Renderable\RootRenderableInterface|null,
32
 *     Domain\Renderable\ViewModel\ViewModel|null,
33
 * ): mixed
34
 */
35
final readonly class ValueResolutionContext
36
{
37
    /**
38
     * @param ProcessorClosure|null $renderableProcessor
39
     */
40
    public function __construct(
×
41
        public Form\Domain\Model\Renderable\RootRenderableInterface $renderable,
42
        public Domain\Renderable\ViewModel\ViewModel $viewModel,
43
        public Form\Domain\Runtime\FormRuntime $formRuntime,
44
        private ?\Closure $renderableProcessor = null,
45
    ) {}
×
46

47
    /**
48
     * @param array<string|int, mixed> $configuration
49
     */
50
    public function process(
×
51
        array $configuration = [],
52
        ?Form\Domain\Model\Renderable\RootRenderableInterface $renderable = null,
53
        ?Domain\Renderable\ViewModel\ViewModel $viewModel = null,
54
    ): mixed {
55
        if ($this->renderableProcessor === null) {
×
56
            return null;
×
57
        }
58

59
        return ($this->renderableProcessor)($configuration, $renderable, $viewModel);
×
60
    }
61

62
    public function withRenderable(Form\Domain\Model\Renderable\RootRenderableInterface $renderable): self
×
63
    {
NEW
64
        return new self($renderable, $this->viewModel, $this->formRuntime, $this->renderableProcessor);
×
65
    }
66

67
    public function withViewModel(Domain\Renderable\ViewModel\ViewModel $viewModel): self
×
68
    {
NEW
69
        return new self($this->renderable, $viewModel, $this->formRuntime, $this->renderableProcessor);
×
70
    }
71
}
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