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

CPS-IT / handlebars-forms / 22666993507

04 Mar 2026 11:15AM UTC coverage: 0.0%. Remained the same
22666993507

push

github

eliashaeussler
[FEATURE] Provide `TRANSLATE_PROPERTY` value resolver

0 of 17 new or added lines in 1 file covered. (0.0%)

35 existing lines in 3 files now uncovered.

0 of 642 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
/Classes/DataProcessing/Value/TranslatePropertyValueResolver.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\DataProcessing\Value;
19

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

24
/**
25
 * TranslatePropertyValueProcessor
26
 *
27
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
28
 * @license GPL-2.0-or-later
29
 */
30
final readonly class TranslatePropertyValueResolver implements ValueResolver
31
{
NEW
32
    public function __construct(
×
33
        private Fluid\ViewHelperInvoker $viewHelperInvoker,
NEW
34
    ) {}
×
35

NEW
36
    public function resolve(
×
37
        Form\Domain\Model\Renderable\RootRenderableInterface $renderable,
38
        Domain\Renderable\ViewModel\ViewModel $viewModel,
39
        ValueResolutionContext $context = new ValueResolutionContext(),
40
    ): mixed {
NEW
41
        $property = $context['property'];
×
NEW
42
        $argumentName = $context['argumentName'];
×
43

NEW
44
        if (!is_string($property)) {
×
NEW
45
            return null;
×
46
        }
47

NEW
48
        if (!in_array($argumentName, ['property', 'renderingOptionProperty'], true)) {
×
NEW
49
            $argumentName = 'property';
×
50
        }
51

NEW
52
        return $this->viewHelperInvoker->translateElementProperty(
×
NEW
53
            $viewModel->renderingContext,
×
NEW
54
            $renderable,
×
NEW
55
            $property,
×
NEW
56
            $argumentName,
×
NEW
57
        );
×
58
    }
59

NEW
60
    public static function getName(): string
×
61
    {
NEW
62
        return 'TRANSLATE_PROPERTY';
×
63
    }
64
}
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