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

Yoast / Yoast-SEO-for-TYPO3 / 13327579701

14 Feb 2025 10:43AM UTC coverage: 1.276%. First build
13327579701

push

github

web-flow
Merge pull request #597 from Yoast/feature/v11

[FEATURE] Release 11.0.0

21 of 894 new or added lines in 76 files covered. (2.35%)

35 of 2744 relevant lines covered (1.28%)

0.04 hits per line

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

0.0
/Classes/Service/Preview/ContentParser.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace YoastSeoForTypo3\YoastSeo\Service\Preview;
6

7
use YoastSeoForTypo3\YoastSeo\Service\Preview\ContentExtractors\BaseUrlParserInterface;
8
use YoastSeoForTypo3\YoastSeo\Service\Preview\ContentExtractors\BodyProcessorInterface;
9
use YoastSeoForTypo3\YoastSeo\Service\Preview\ContentExtractors\ContentMetadataExtractorInterface;
10
use YoastSeoForTypo3\YoastSeo\Service\Preview\ContentExtractors\FaviconExtractorInterface;
11
use YoastSeoForTypo3\YoastSeo\Service\Preview\ContentExtractors\TitleConfigurationExtractorInterface;
12

13
class ContentParser
14
{
15
    public function __construct(
16
        protected BaseUrlParserInterface $baseUrlParser,
17
        protected BodyProcessorInterface $bodyProcessor,
18
        protected ContentMetadataExtractorInterface $contentMetadataExtractor,
19
        protected FaviconExtractorInterface $faviconExtractor,
20
        protected TitleConfigurationExtractorInterface $titleConfigurationExtractor,
NEW
21
    ) {}
×
22

23
    /**
24
     * @return array<string, int|string>
25
     */
26
    public function parse(string $content, string $uriToCheck, int $pageId): array
27
    {
NEW
28
        $urlParts = parse_url((string)preg_replace('/\/$/', '', $uriToCheck));
×
NEW
29
        $baseUrl = $this->baseUrlParser->getBaseUrl($urlParts);
×
NEW
30
        $url = $baseUrl . ($urlParts['path'] ?? '');
×
31

NEW
32
        $titleConfiguration = $this->titleConfigurationExtractor->getTitleConfiguration($content);
×
33

NEW
34
        return [
×
NEW
35
            'id' => $pageId,
×
NEW
36
            'url' => $url,
×
NEW
37
            'baseUrl' => $baseUrl,
×
NEW
38
            'slug' => '/',
×
NEW
39
            'title' => $this->contentMetadataExtractor->getTitle($content),
×
NEW
40
            'description' => $this->contentMetadataExtractor->getDescription($content),
×
NEW
41
            'locale' => $this->contentMetadataExtractor->getLocale($content),
×
NEW
42
            'body' => $this->bodyProcessor->getBody($content),
×
NEW
43
            'faviconSrc' => $this->faviconExtractor->getFaviconSrc($baseUrl, $content),
×
NEW
44
            'pageTitlePrepend' => $titleConfiguration['titlePrepend'],
×
NEW
45
            'pageTitleAppend' => $titleConfiguration['titleAppend'],
×
NEW
46
        ];
×
47
    }
48
}
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