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

CPS-IT / handlebars / 12791317399

15 Jan 2025 03:13PM UTC coverage: 93.186% (-0.3%) from 93.514%
12791317399

push

github

web-flow
Merge pull request #398 from CPS-IT/feature/1.x/cacheable

[FEATURE] Populate and read cacheable state of template path providers

16 of 20 new or added lines in 3 files covered. (80.0%)

1 existing line in 1 file now uncovered.

971 of 1042 relevant lines covered (93.19%)

3.85 hits per line

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

77.78
/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
 * Copyright (C) 2025 Elias Häußler <e.haeussler@familie-redlich.de>
9
 *
10
 * This program is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU General Public License as published by
12
 * the Free Software Foundation, either version 2 of the License, or
13
 * (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22
 */
23

24
namespace Fr\Typo3Handlebars\Renderer\Template\Path;
25

26
use Fr\Typo3Handlebars\Configuration;
27
use TYPO3\CMS\Extbase;
28

29
/**
30
 * TypoScriptPathProvider
31
 *
32
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
33
 * @license GPL-2.0-or-later
34
 */
35
final class TypoScriptPathProvider implements PathProvider
36
{
37
    /**
38
     * @var array<string, mixed>|null
39
     */
40
    private ?array $viewConfiguration = null;
41

42
    public function __construct(
2✔
43
        private readonly Extbase\Configuration\ConfigurationManagerInterface $configurationManager,
44
    ) {}
2✔
45

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

51
    public function getTemplateRootPaths(): array
1✔
52
    {
53
        return $this->getViewConfiguration()[self::TEMPLATES] ?? [];
1✔
54
    }
55

NEW
56
    public function isCacheable(): bool
×
57
    {
NEW
58
        return true;
×
59
    }
60

61
    /**
62
     * @return array{partialRootPaths?: array<int, string>, templateRootPaths?: array<int, string>}
63
     */
64
    private function getViewConfiguration(): array
2✔
65
    {
66
        if ($this->viewConfiguration === null) {
2✔
67
            $typoScriptConfiguration = $this->configurationManager->getConfiguration(
2✔
68
                Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK,
2✔
69
                Configuration\Extension::NAME,
2✔
70
            );
2✔
71
            $this->viewConfiguration = $typoScriptConfiguration['view'] ?? [];
2✔
72
        }
73

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

77
    public static function getPriority(): int
×
78
    {
79
        return 50;
×
80
    }
81
}
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