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

CPS-IT / handlebars-forms / 22712409024

05 Mar 2026 09:55AM UTC coverage: 0.0%. Remained the same
22712409024

push

github

eliashaeussler
[TASK] Allow `ValueResolutionContext` cloning with custom configuration

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

14 existing lines in 1 file now uncovered.

0 of 646 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/DataProcessing/Value/ValueResolutionContext.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\DataProcessing\Value;
19

20
use CPSIT\Typo3HandlebarsForms\Domain;
21
use TYPO3\CMS\Form;
22

23
/**
24
 * ValueResolutionContext
25
 *
26
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
27
 * @license GPL-2.0-or-later
28
 *
29
 * @implements \ArrayAccess<string, mixed>
30
 * @implements \IteratorAggregate<string, mixed>
31
 *
32
 * @phpstan-type ProcessorClosure \Closure(
33
 *     array<string, mixed>,
34
 *     Form\Domain\Model\Renderable\RootRenderableInterface|null,
35
 *     Domain\Renderable\ViewModel\ViewModel|null,
36
 * ): mixed
37
 */
38
final readonly class ValueResolutionContext implements \ArrayAccess, \IteratorAggregate
39
{
40
    /**
41
     * @param array<string, mixed> $configuration
42
     * @param ProcessorClosure|null $renderableProcessor
43
     */
UNCOV
44
    public function __construct(
×
45
        public array $configuration = [],
46
        private ?\Closure $renderableProcessor = null,
UNCOV
47
    ) {}
×
48

49
    /**
50
     * @param array<string, mixed> $configuration
51
     */
UNCOV
52
    public function process(
×
53
        array $configuration = [],
54
        ?Form\Domain\Model\Renderable\RootRenderableInterface $renderable = null,
55
        ?Domain\Renderable\ViewModel\ViewModel $viewModel = null,
56
    ): mixed {
57
        if ($this->renderableProcessor === null) {
×
UNCOV
58
            return null;
×
59
        }
60

UNCOV
61
        return ($this->renderableProcessor)($configuration, $renderable, $viewModel);
×
62
    }
63

64
    /**
65
     * @param array<string, mixed> $configuration
66
     */
NEW
67
    public function withConfiguration(array $configuration): self
×
68
    {
NEW
69
        return new self($configuration, $this->renderableProcessor);
×
70
    }
71

72
    public function offsetExists(mixed $offset): bool
×
73
    {
UNCOV
74
        return \array_key_exists($offset, $this->configuration);
×
75
    }
76

UNCOV
77
    public function offsetGet(mixed $offset): mixed
×
78
    {
UNCOV
79
        return $this->configuration[$offset] ?? null;
×
80
    }
81

UNCOV
82
    public function offsetSet(mixed $offset, mixed $value): void
×
83
    {
84
        // Not allowed.
UNCOV
85
    }
×
86

UNCOV
87
    public function offsetUnset(mixed $offset): void
×
88
    {
89
        // Not allowed.
UNCOV
90
    }
×
91

UNCOV
92
    public function getIterator(): \Traversable
×
93
    {
UNCOV
94
        return new \ArrayIterator($this->configuration);
×
95
    }
96
}
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