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

CPS-IT / handlebars-forms / 23790397207

31 Mar 2026 09:29AM UTC coverage: 0.654% (-0.003%) from 0.657%
23790397207

push

github

eliashaeussler
[FEATURE] Allow access to various objects in `HBS_PROPERTY`

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

7 of 1070 relevant lines covered (0.65%)

0.03 hits per line

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

0.0
/Classes/ContentObject/PropertyContentObject.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\Extbase;
22

23
/**
24
 * PropertyContentObject
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_PROPERTY'])]
30
final class PropertyContentObject extends AbstractHandlebarsFormsContentObject
31
{
32
    public function resolve(array $configuration, Context\ValueResolutionContext $context): mixed
×
33
    {
34
        $path = $configuration['path'] ?? null;
×
NEW
35
        $subject = match ($configuration['subject'] ?? null) {
×
NEW
36
            'formRuntime' => $context->formRuntime,
×
NEW
37
            'viewModel' => $context->viewModel,
×
NEW
38
            default => $context->renderable,
×
NEW
39
        };
×
40

41
        if (!is_string($path)) {
×
42
            return null;
×
43
        }
44

NEW
45
        return Extbase\Reflection\ObjectAccess::getProperty($subject, $path);
×
46
    }
47
}
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