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

Yoast / Yoast-SEO-for-TYPO3 / 21521134747

30 Jan 2026 03:30PM UTC coverage: 0.866% (-0.4%) from 1.275%
21521134747

push

github

RinyVT
[FEATURE] Version 12.0.0, added v14 support, removed v11 support including php8.0 and php8.1, rewrote backend javascript functionality to typescript and webcomponents

0 of 550 new or added lines in 53 files covered. (0.0%)

33 existing lines in 21 files now uncovered.

23 of 2657 relevant lines covered (0.87%)

0.03 hits per line

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

0.0
/Classes/Service/Frontend/FrontendService.php
1
<?php
2

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

10
declare(strict_types=1);
11

12
namespace YoastSeoForTypo3\YoastSeo\Service\Frontend;
13

14
use Psr\Http\Message\ServerRequestInterface;
15
use Symfony\Component\DependencyInjection\Attribute\Autowire;
16
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
17
use TYPO3\CMS\Core\Context\Context;
18
use TYPO3\CMS\Core\Http\ApplicationType;
19
use TYPO3\CMS\Core\Information\Typo3Version;
20
use TYPO3\CMS\Core\Utility\GeneralUtility;
21
use TYPO3\CMS\Frontend\Cache\CacheLifetimeCalculator;
22
use TYPO3\CMS\Frontend\Page\PageInformation;
23

24
readonly class FrontendService implements FrontendServiceInterface
25
{
26
    public function __construct(
27
        #[Autowire(service: 'cache.runtime')]
28
        private FrontendInterface $runtimeCache,
NEW
29
    ) {}
×
30

31
    public function isFrontendRequest(): bool
32
    {
NEW
33
        return $this->getRequest() && ApplicationType::fromRequest($this->getRequest())->isFrontend();
×
34
    }
35

36
    /**
37
     * @return array<string, mixed>
38
     */
39
    public function getTyposcriptConfiguration(): array
40
    {
NEW
41
        return $this->getRequest()?->getAttribute('frontend.typoscript')?->getConfigArray() ?? [];
×
42
    }
43

44
    public function getPageUid(): int
45
    {
NEW
46
        return $this->getPageInformation()?->getId() ?? 0;
×
47
    }
48

49
    /**
50
     * @return array<int, array<string, mixed>>
51
     */
52
    public function getRootLine(): array
53
    {
NEW
54
        return $this->getPageInformation()?->getRootLine() ?? [];
×
55
    }
56

57
    public function isSiteRoot(): bool
58
    {
NEW
59
        return (bool)($this->getPageInformation()?->getPageRecord()['is_siteroot'] ?? false);
×
60
    }
61

62
    public function getCacheIdentifier(string $suffix): string
63
    {
NEW
64
        return $this->runtimeCache->get(FrontendServiceInterface::CACHE_IDENTIFIER) . $suffix;
×
65
    }
66

67
    public function getCacheTimeout(): int
68
    {
NEW
69
        if ($this->getRequest() === null || $this->getPageInformation() === null) {
×
NEW
70
            return 0;
×
71
        }
72

NEW
73
        $arguments = [
×
NEW
74
            'pageId' => $this->getPageInformation()->getId(),
×
NEW
75
            'pageRecord' => $this->getPageInformation()->getPageRecord(),
×
NEW
76
            'renderingInstructions' => $this->getTyposcriptConfiguration(),
×
NEW
77
            'context' => GeneralUtility::makeInstance(Context::class),
×
NEW
78
        ];
×
79

NEW
80
        if ((new Typo3Version())->getMajorVersion() === 13) {
×
NEW
81
            $arguments['defaultCacheTimoutInSeconds'] = 0;
×
82
        }
83

NEW
84
        return GeneralUtility::makeInstance(CacheLifetimeCalculator::class)
×
NEW
85
            ->calculateLifetimeForPage(...$arguments);
×
86
    }
87

88
    protected function getPageInformation(): ?PageInformation
89
    {
NEW
90
        return $this->getRequest()?->getAttribute('frontend.page.information');
×
91
    }
92

93
    protected function getRequest(): ?ServerRequestInterface
94
    {
NEW
95
        return $GLOBALS['TYPO3_REQUEST'] ?? null;
×
96
    }
97
}
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