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

CPS-IT / handlebars / 23363698435

20 Mar 2026 09:40PM UTC coverage: 89.861% (-0.4%) from 90.285%
23363698435

Pull #543

github

web-flow
Merge 223a31852 into 86597a598
Pull Request #543: [TASK] Update codebase to match PHPStan max level

139 of 157 new or added lines in 43 files covered. (88.54%)

26 existing lines in 11 files now uncovered.

1356 of 1509 relevant lines covered (89.86%)

6.82 hits per line

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

76.19
/Classes/Renderer/Template/Path/TypoScriptPathProvider.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\Template\Path;
19

20
use CPSIT\Typo3Handlebars\Configuration;
21
use TYPO3\CMS\Extbase;
22

23
/**
24
 * TypoScriptPathProvider
25
 *
26
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
27
 * @license GPL-2.0-or-later
28
 */
29
final class TypoScriptPathProvider implements PathProvider
30
{
31
    /**
32
     * @var array<self::*, mixed>|null
33
     */
34
    private ?array $viewConfiguration = null;
35

36
    public function __construct(
2✔
37
        private readonly Extbase\Configuration\ConfigurationManagerInterface $configurationManager,
38
    ) {}
2✔
39

40
    public function getPartialRootPaths(): array
1✔
41
    {
42
        return $this->getViewConfiguration()[self::PARTIALS] ?? [];
1✔
43
    }
44

45
    public function getTemplateRootPaths(): array
1✔
46
    {
47
        return $this->getViewConfiguration()[self::TEMPLATES] ?? [];
1✔
48
    }
49

50
    public function isCacheable(): bool
×
51
    {
52
        return true;
×
53
    }
54

55
    /**
56
     * @return array{partialRootPaths?: array<int, string>, templateRootPaths?: array<int, string>}
57
     */
58
    private function getViewConfiguration(): array
2✔
59
    {
60
        if ($this->viewConfiguration === null) {
2✔
61
            $typoScriptConfiguration = $this->configurationManager->getConfiguration(
2✔
62
                Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK,
2✔
63
                Configuration\Extension::NAME,
2✔
64
            );
2✔
65
            $viewConfiguration = $typoScriptConfiguration['view'] ?? [];
2✔
66

67
            if (\is_array($viewConfiguration)) {
2✔
68
                $this->viewConfiguration = \array_intersect_key($viewConfiguration, [self::PARTIALS => true, self::TEMPLATES => true]);
2✔
69
            } else {
NEW
UNCOV
70
                $this->viewConfiguration = [];
×
71
            }
72
        }
73

74
        return $this->viewConfiguration;
2✔
75
    }
76

UNCOV
77
    public static function getPriority(): int
×
78
    {
UNCOV
79
        return 50;
×
80
    }
81
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc