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

CPS-IT / handlebars-forms / 23292751039

19 Mar 2026 11:29AM UTC coverage: 0.0%. Remained the same
23292751039

Pull #12

github

web-flow
Merge 4a7d4bbcb into 7283fb55c
Pull Request #12: feature/cobj decorator

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

0 of 822 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/ContextAwareContentObjectDecorator.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 Symfony\Component\DependencyInjection;
21
use TYPO3\CMS\Frontend;
22

23
/**
24
 * ContextAwareContentObjectDecorator
25
 *
26
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
27
 * @license GPL-2.0-or-later
28
 *
29
 * @internal
30
 */
31
#[DependencyInjection\Attribute\AsDecorator(Frontend\ContentObject\AbstractContentObject::class)]
32
final class ContextAwareContentObjectDecorator extends Frontend\ContentObject\AbstractContentObject
33
{
NEW
34
    public function __construct(
×
35
        #[DependencyInjection\Attribute\AutowireDecorated]
36
        private readonly Frontend\ContentObject\AbstractContentObject $contentObject,
37
        private readonly Context\ValueCollector $valueCollector,
NEW
38
    ) {}
×
39

40
    /**
41
     * @param array<string|int, mixed> $conf
42
     */
NEW
43
    public function render($conf = []): string
×
44
    {
NEW
45
        $value = (string)$this->contentObject->render($conf);
×
46

NEW
47
        if (!$this->valueCollector->has($value)) {
×
NEW
48
            return $value;
×
49
        }
50

NEW
51
        $resolvedValue = $this->valueCollector->load($value);
×
52

NEW
53
        if (!is_scalar($resolvedValue)) {
×
NEW
54
            return $value;
×
55
        }
56

NEW
57
        return (string)$resolvedValue;
×
58
    }
59
}
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