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

CPS-IT / handlebars-forms / 25426556929

06 May 2026 09:12AM UTC coverage: 0.548% (-0.008%) from 0.556%
25426556929

Pull #37

github

web-flow
Merge 6bbaf721f into 9b3f4bd22
Pull Request #37: [FEATURE] Add support for TYPO3 v14.3 LTS

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

1 existing line in 1 file now uncovered.

7 of 1277 relevant lines covered (0.55%)

0.02 hits per line

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

0.0
/Classes/ContentObject/ChildrenContentObject.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;
19

20
use CPSIT\Typo3HandlebarsForms\Domain;
21
use Symfony\Component\DependencyInjection;
22
use TYPO3\CMS\Core;
23

24
/**
25
 * ChildrenContentObject
26
 *
27
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
28
 * @license GPL-2.0-or-later
29
 */
30
#[DependencyInjection\Attribute\AutoconfigureTag('frontend.contentobject', ['identifier' => 'HBS_CHILDREN'])]
31
final class ChildrenContentObject extends AbstractHandlebarsFormsContentObject
32
{
33
    use CanUpdateRegister;
34

35
    private const IDENTIFIER_COUNT = 'HBS_CHILDREN_COUNT';
36
    private const IDENTIFIER_CURRENT = 'HBS_CHILDREN_CURRENT';
37

NEW
38
    public function __construct()
×
39
    {
NEW
40
        $this->typo3Version = new Core\Information\Typo3Version();
×
41
    }
42

43
    /**
44
     * @return list<mixed>|null
45
     */
46
    protected function resolve(array $configuration, Context\ValueResolutionContext $context): ?array
×
47
    {
48
        if (!($context->viewModel instanceof Domain\ViewModel\CompositeViewModel)) {
×
49
            return null;
×
50
        }
51

52
        $children = $context->viewModel->getChildren();
×
53

54
        if ($children === []) {
×
55
            return null;
×
56
        }
57

58
        $processedValue = [];
×
59

60
        // Add children count to register
NEW
61
        $this->updateRegister(self::IDENTIFIER_COUNT, count($children));
×
62

63
        foreach ($children as $index => $childViewModel) {
×
64
            // Add current child index to TSFE register
NEW
65
            $this->updateRegister(self::IDENTIFIER_CURRENT, count($children));
×
66

67
            try {
68
                $processedValue[] = $context->process($configuration, viewModel: $childViewModel);
×
69
            } finally {
NEW
70
                $this->updateRegister(self::IDENTIFIER_CURRENT);
×
71
            }
72
        }
73

NEW
74
        $this->updateRegister(self::IDENTIFIER_COUNT);
×
75

76
        return $processedValue;
×
77
    }
78
}
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