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

CPS-IT / handlebars-forms / 23477102620

24 Mar 2026 06:57AM UTC coverage: 0.0%. Remained the same
23477102620

push

github

eliashaeussler
[FEATURE] Provide `StringUtility` for better handling of stringables

0 of 26 new or added lines in 5 files covered. (0.0%)

1 existing line in 1 file now uncovered.

0 of 879 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/TagContentObject.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 DevTheorem\Handlebars;
21
use Symfony\Component\DependencyInjection;
22

23
/**
24
 * TagContentObject
25
 *
26
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
27
 * @license GPL-2.0-or-later
28
 */
29
#[DependencyInjection\Attribute\AutoconfigureTag('frontend.contentobject', ['identifier' => 'HBS_TAG'])]
30
final class TagContentObject extends AbstractHandlebarsFormsContentObject
31
{
NEW
32
    protected function resolve(array $configuration, Context\ValueResolutionContext $context): ?Handlebars\SafeString
×
33
    {
34
        if (!array_key_exists('attribute', $configuration)) {
×
NEW
35
            return $this->safeString($context->viewModel->tag->getContent());
×
36
        }
37

38
        $attributeName = $configuration['attribute'] ?? null;
×
39

40
        if (!is_string($attributeName)) {
×
41
            return null;
×
42
        }
43

NEW
44
        return $this->safeString($context->viewModel->tag->getAttribute($attributeName));
×
45
    }
46

NEW
47
    private function safeString(?string $content): ?Handlebars\SafeString
×
48
    {
NEW
49
        if ($content === null) {
×
NEW
50
            return null;
×
51
        }
52

NEW
53
        return new Handlebars\SafeString($content);
×
54
    }
55
}
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