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

CPS-IT / handlebars-forms / 23788866234

31 Mar 2026 08:52AM UTC coverage: 0.659% (-0.06%) from 0.72%
23788866234

push

github

web-flow
Merge pull request #18 from CPS-IT/feature/view-models

0 of 163 new or added lines in 33 files covered. (0.0%)

7 of 1062 relevant lines covered (0.66%)

0.03 hits per line

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

0.0
/Classes/Domain/ViewModel/FormFieldViewModel.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\Domain\ViewModel;
19

20
use TYPO3\CMS\Form;
21
use TYPO3Fluid\Fluid;
22

23
/**
24
 * FormFieldViewModel
25
 *
26
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
27
 * @license GPL-2.0-or-later
28
 *
29
 * @extends \ArrayObject<string|int, mixed>
30
 */
31
final class FormFieldViewModel extends \ArrayObject implements TagAwareViewModel
32
{
NEW
33
    public function __construct(
×
34
        public readonly Fluid\Core\ViewHelper\TagBuilder $label,
35
        public readonly ViewModel $element,
36
    ) {
NEW
37
        parent::__construct([]);
×
38
    }
39

NEW
40
    public static function forLabelAndElement(?string $label, ViewModel $element): self
×
41
    {
NEW
42
        return new self(
×
NEW
43
            new Fluid\Core\ViewHelper\TagBuilder('label', $label),
×
NEW
44
            $element,
×
NEW
45
        );
×
46
    }
47

NEW
48
    public function getRenderable(): Form\Domain\Model\Renderable\RootRenderableInterface
×
49
    {
NEW
50
        return $this->element->getRenderable();
×
51
    }
52

NEW
53
    public function getTag(): Fluid\Core\ViewHelper\TagBuilder
×
54
    {
NEW
55
        if ($this->element instanceof TagAwareViewModel) {
×
NEW
56
            return $this->element->getTag();
×
57
        }
58

NEW
59
        return $this->label;
×
60
    }
61
}
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