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

CPS-IT / handlebars / 27536736573

15 Jun 2026 09:25AM UTC coverage: 88.909% (-0.9%) from 89.785%
27536736573

Pull #588

github

web-flow
Merge d526cb2dc into f9e58be95
Pull Request #588: [FEATURE] Provide `get` helper for object access

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

1459 of 1641 relevant lines covered (88.91%)

7.11 hits per line

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

0.0
/Classes/Renderer/Helper/GetHelper.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the TYPO3 CMS extension "handlebars".
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\Typo3Handlebars\Renderer\Helper;
19

20
use CPSIT\Typo3Handlebars\Attribute;
21
use CPSIT\Typo3Handlebars\Exception;
22
use DevTheorem\Handlebars;
23
use TYPO3\CMS\Extbase;
24

25
/**
26
 * GetHelper
27
 *
28
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
29
 * @license GPL-2.0-or-later
30
 */
31
#[Attribute\AsHelper('get')]
32
final readonly class GetHelper implements Helper
33
{
34
    /**
35
     * @throws Exception\TypeIsNotSupported
36
     * @throws Extbase\Reflection\Exception\PropertyNotAccessibleException
37
     */
NEW
38
    public function render(Handlebars\HelperOptions $options, mixed $subject = null, ?string $name = null): mixed
×
39
    {
NEW
40
        if (!is_object($subject) && !is_array($subject)) {
×
NEW
41
            throw new Exception\TypeIsNotSupported(['object', 'array'], $subject);
×
42
        }
43

NEW
44
        if (!is_string($name)) {
×
NEW
45
            return null;
×
46
        }
47

NEW
48
        return Extbase\Reflection\ObjectAccess::getProperty($subject, $name);
×
49
    }
50
}
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