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

CPS-IT / handlebars-forms / 25365571812

05 May 2026 08:20AM UTC coverage: 0.548% (-0.008%) from 0.556%
25365571812

Pull #37

github

web-flow
Merge e8c23a5d6 into b6ae5cff1
Pull Request #37: [FEATURE] Add support for TYPO3 v14.3 LTS

0 of 31 new or added lines in 4 files covered. (0.0%)

1 existing line in 1 file now uncovered.

7 of 1277 relevant lines covered (0.55%)

0.02 hits per line

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

0.0
/Classes/ContentObject/CanUpdateRegister.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 Psr\Http\Message;
21
use TYPO3\CMS\Core;
22
use TYPO3\CMS\Frontend;
23

24
/**
25
 * CanUpdateRegister
26
 *
27
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
28
 * @license GPL-2.0-or-later
29
 * @internal
30
 *
31
 * @property Message\ServerRequestInterface $request
32
 */
33
trait CanUpdateRegister
34
{
35
    protected Core\Information\Typo3Version $typo3Version;
36

NEW
37
    protected function updateRegister(string $key, ?int $value = null): void
×
38
    {
NEW
39
        match ($this->typo3Version->getMajorVersion()) {
×
NEW
40
            13 => $this->modifyRegisterUsingTsfe($key, $value),
×
NEW
41
            14 => $this->modifyRegisterUsingRequest($key, $value),
×
NEW
42
            default => null,
×
NEW
43
        };
×
44
    }
45

46
    /**
47
     * @todo Remove once support for TYPO3 v13 is dropped
48
     */
NEW
49
    protected function modifyRegisterUsingTsfe(string $key, ?int $value): void
×
50
    {
NEW
51
        $tsfe = $this->getTypoScriptFrontendController();
×
52

NEW
53
        if ($value === null) {
×
NEW
54
            unset($tsfe->register[$key]);
×
55
        } else {
NEW
56
            $tsfe->register[$key] = $value;
×
57
        }
58
    }
59

NEW
60
    protected function modifyRegisterUsingRequest(string $key, ?int $value): void
×
61
    {
NEW
62
        $stack = $this->request->getAttribute('frontend.register.stack');
×
63

NEW
64
        if (!($stack instanceof Frontend\ContentObject\RegisterStack)) {
×
NEW
65
            return;
×
66
        }
67

NEW
68
        if ($value !== null) {
×
NEW
69
            $stack->current()->set($key, $value);
×
70
        }
71
    }
72
}
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