• 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/SiteService.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;
13

14
use TYPO3\CMS\Core\Exception\SiteNotFoundException;
15
use TYPO3\CMS\Core\Site\Entity\Site;
16
use TYPO3\CMS\Core\Site\SiteFinder;
17

18
class SiteService
19
{
20
    /**
21
     * @var array<int, Site>
22
     */
23
    protected array $sites = [];
24

25
    public function __construct(
26
        protected SiteFinder $siteFinder
NEW
27
    ) {}
×
28

29
    public function getSiteByPageId(int $pageId): ?Site
30
    {
NEW
31
        if (isset($this->sites[$pageId])) {
×
NEW
32
            return $this->sites[$pageId];
×
33
        }
34

35
        try {
NEW
36
            $site = $this->siteFinder->getSiteByPageId($pageId);
×
NEW
37
            $this->sites[$pageId] = $site;
×
NEW
38
            return $site;
×
NEW
39
        } catch (SiteNotFoundException) {
×
NEW
40
            return null;
×
41
        }
42
    }
43

44
    public function getSiteRootPageId(int $pageUid): int
45
    {
NEW
46
        $site = $this->getSiteByPageId($pageUid);
×
NEW
47
        if ($site) {
×
NEW
48
            return $site->getRootPageId();
×
49
        }
50

NEW
51
        return 0;
×
52
    }
53

54
    public function getWebsiteTitle(int $pageUid, int $languageId): string
55
    {
NEW
56
        $site = $this->getSiteByPageId($pageUid);
×
NEW
57
        if (!$site) {
×
NEW
58
            return '';
×
59
        }
60

NEW
61
        $language = $site->getLanguageById($languageId);
×
NEW
62
        if (trim($language->getWebsiteTitle()) !== '') {
×
NEW
63
            return $language->getWebsiteTitle();
×
64
        }
NEW
65
        if (trim($site->getConfiguration()['websiteTitle'] ?? '') !== '') {
×
NEW
66
            return $site->getConfiguration()['websiteTitle'];
×
67
        }
68

NEW
69
        return '';
×
70
    }
71
}
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