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

CPS-IT / handlebars-forms / 23132858873

16 Mar 2026 07:36AM UTC coverage: 0.0%. Remained the same
23132858873

push

github

web-flow
Merge pull request #10 from CPS-IT/feature/cobj

[FEATURE] Convert value resolvers to context-aware content objects

0 of 88 new or added lines in 11 files covered. (0.0%)

2 existing lines in 1 file now uncovered.

0 of 696 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/Context/ValueCollector.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\Context;
19

20
use CPSIT\Typo3HandlebarsForms\ContentObject;
21
use Symfony\Component\DependencyInjection;
22
use TYPO3\CMS\Core;
23

24
/**
25
 * ValueCollector
26
 *
27
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
28
 * @license GPL-2.0-or-later
29
 *
30
 * @internal
31
 */
32
final readonly class ValueCollector
33
{
34
    private const CACHE_IDENTIFIER_PREFIX = 'HandlebarsFormsValue_';
35

NEW
36
    public function __construct(
×
37
        #[DependencyInjection\Attribute\Autowire(service: 'cache.runtime')]
38
        private Core\Cache\Frontend\FrontendInterface $cache,
NEW
39
    ) {}
×
40

NEW
41
    public function save(ContentObject\AbstractHandlebarsFormsContentObject $contentObject, mixed $value): string
×
42
    {
NEW
43
        $identifier = Core\Utility\StringUtility::getUniqueId(
×
NEW
44
            self::CACHE_IDENTIFIER_PREFIX . spl_object_hash($contentObject),
×
NEW
45
        );
×
46

NEW
47
        $this->cache->set($identifier, $value);
×
48

NEW
49
        return $identifier;
×
50
    }
51

NEW
52
    public function load(string $identifier): mixed
×
53
    {
NEW
54
        if (!$this->cache->has($identifier)) {
×
NEW
55
            return null;
×
56
        }
57

NEW
58
        return $this->cache->get($identifier);
×
59
    }
60

NEW
61
    public function has(string $identifier): bool
×
62
    {
NEW
63
        return $this->cache->has($identifier);
×
64
    }
65
}
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