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

fnagel / t3extblog / 23823603081

31 Mar 2026 11:05PM UTC coverage: 37.437% (-12.6%) from 50.045%
23823603081

push

github

fnagel
[FEATURE] Add YAML lint to composer scripts and CI

Using the new TYPO3 14.2 built in YAML linter.

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.3/Feature-104973-ActivateLintYamlExecutableForTYPO3.html

1256 of 3355 relevant lines covered (37.44%)

3.11 hits per line

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

48.28
/Classes/Service/SettingsService.php
1
<?php
2

3
namespace FelixNagel\T3extblog\Service;
4

5
/**
6
 * This file is part of the "t3extblog" Extension for TYPO3 CMS.
7
 *
8
 * For the full copyright and license information, please read the
9
 * LICENSE.txt file that was distributed with this source code.
10
 */
11

12
use Psr\Http\Message\ServerRequestInterface;
13
use TYPO3\CMS\Core\Http\ApplicationType;
14
use TYPO3\CMS\Core\TypoScript\TypoScriptService;
15
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
16
use TYPO3\CMS\Extbase\Configuration\Exception;
17
use TYPO3\CMS\Extbase\Reflection\ObjectAccess;
18

19
/**
20
 * Provide a way to get the configuration just everywhere.
21
 */
22
class SettingsService
23
{
24
    /**
25
     * Extension name.
26
     *
27
     * Needed as parameter for configurationManager->getConfiguration when used in BE context
28
     * Otherwise generated TS will be incorrect or missing
29
     */
30
    protected string $extensionName = 'T3extblog';
31

32
    /**
33
     * Plugin name.
34
     *
35
     * Needed as parameter for configurationManager->getConfiguration when used in BE context
36
     * Otherwise generated TS will be incorrect or missing when used in BE
37
     */
38
    protected string $pluginName = '';
39

40
    protected ?array $typoScriptSettings = null;
41

42
    protected ?array $frameworkSettings = null;
43

44
    /**
45
     * Make sure TS in BE context is generated from currently selected page.
46
     *
47
     * Needed basically to make extbase work in some situations. Without PID is set to 0
48
     * (which is root) and persistence, TS generation, etc. will fail. This is the case
49
     * in TYPO3 8-13 when editing a record.
50
     *
51
     * Example: right-click on a record using the context menu in the blog (or list)
52
     * BE module and use edit (tab access, change to valid and click save) or change
53
     * visibility directly in context menu or using the quick-edit links in the blog
54
     * module which should trigger emails but does not without this fix.
55
     */
56
    public function __construct(protected ConfigurationManagerInterface $configurationManager, protected TypoScriptService $typoScriptService)
42✔
57
    {
58
        if (isset($GLOBALS['TYPO3_REQUEST']) && ($request = $GLOBALS['TYPO3_REQUEST']) instanceof ServerRequestInterface &&
42✔
59
            !ApplicationType::fromRequest($request)->isFrontend()
42✔
60
        ) {
61
            $this->configurationManager->setRequest($request->withQueryParams([
×
62
                ...$request->getQueryParams(),
×
63
                ...['id' => ($request->getParsedBody()['popViewId'] ?? $request->getQueryParams()['id'] ?? 0)]
×
64
            ]));
×
65
        }
66
    }
67

68
    /**
69
     * Returns all framework settings.
70
     */
71
    public function getFrameworkSettings(): array
×
72
    {
73
        if ($this->frameworkSettings === null) {
×
74
            $this->frameworkSettings = $this->configurationManager->getConfiguration(
×
75
                ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK,
×
76
                $this->extensionName,
×
77
                $this->pluginName
×
78
            );
×
79
        }
80

81
        if ($this->frameworkSettings === null) {
×
82
            throw new Exception('No framework TypoScript configuration available!', 1592249266);
×
83
        }
84

85
        return $this->frameworkSettings;
×
86
    }
87

88
    /**
89
     * Returns all TS settings.
90
     */
91
    public function getTypoScriptSettings(): array
42✔
92
    {
93
        if ($this->typoScriptSettings === null) {
42✔
94
            $this->typoScriptSettings = $this->configurationManager->getConfiguration(
42✔
95
                ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS,
42✔
96
                $this->extensionName,
42✔
97
                $this->pluginName
42✔
98
            );
42✔
99
        }
100

101
        if ($this->typoScriptSettings === null) {
42✔
102
            throw new Exception('No settings TypoScript configuration available!', 1592249324);
×
103
        }
104

105
        return $this->typoScriptSettings;
42✔
106
    }
107

108
    /**
109
     * Returns the settings at path $path, which is separated by ".",
110
     * e.g. "pages.uid".
111
     * "pages.uid" would return $this->settings['pages']['uid'].
112
     *
113
     * If the path is invalid or no entry is found, false is returned.
114
     */
115
    public function getTypoScriptByPath(string $path)
42✔
116
    {
117
        return ObjectAccess::getPropertyPath($this->getTypoScriptSettings(), $path);
42✔
118
    }
119
}
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