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

CPS-IT / handlebars-forms / 23294489338

19 Mar 2026 12:18PM UTC coverage: 0.0%. Remained the same
23294489338

push

github

eliashaeussler
[FEATURE] Populate current index when iterating children and renderables

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

34 existing lines in 2 files now uncovered.

0 of 841 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/ContentObject/AbstractHandlebarsFormsContentObject.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 Psr\Log;
21
use TYPO3\CMS\Frontend;
22

23
/**
24
 * AbstractHandlebarsFormsContentObject
25
 *
26
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
27
 * @license GPL-2.0-or-later
28
 */
29
abstract class AbstractHandlebarsFormsContentObject extends Frontend\ContentObject\AbstractContentObject implements Log\LoggerAwareInterface
30
{
31
    use Log\LoggerAwareTrait;
32

33
    private Context\ContextStack $contextStack;
34
    private Context\ValueCollector $valueCollector;
35

36
    public function injectContextStack(Context\ContextStack $contextStack): void
×
37
    {
38
        $this->contextStack = $contextStack;
×
39
    }
40

41
    public function injectValueCollector(Context\ValueCollector $valueCollector): void
×
42
    {
43
        $this->valueCollector = $valueCollector;
×
44
    }
45

46
    /**
47
     * @param array<string, mixed> $conf
48
     */
49
    final public function render($conf = []): string
×
50
    {
51
        $context = $this->contextStack->current();
×
52

53
        if ($context === null) {
×
54
            $this->logger?->warning(
×
55
                'Using a HBS_* content object in other contexts than "process-form" data processor is not supported.',
×
56
            );
×
57

58
            return '';
×
59
        }
60

61
        $value = $this->resolve($conf, $context);
×
62

UNCOV
63
        if (is_string($value)) {
×
UNCOV
64
            return $this->applyStdWrap($value, $conf);
×
65
        }
66

67
        return $this->valueCollector->save($this, $value);
×
68
    }
69

70
    /**
71
     * @param array<string, mixed> $configuration
72
     */
UNCOV
73
    abstract protected function resolve(array $configuration, Context\ValueResolutionContext $context): mixed;
×
74

75
    /**
76
     * @param array<string, mixed> $configuration
77
     */
UNCOV
78
    private function applyStdWrap(string $value, array $configuration): string
×
79
    {
UNCOV
80
        if (!is_array($configuration['stdWrap.'] ?? null)) {
×
UNCOV
81
            return $value;
×
82
        }
83

UNCOV
84
        return $this->cObj?->stdWrap($value, $configuration['stdWrap.']) ?? $value;
×
85
    }
86
}
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