• 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/SnippetPreviewService.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace YoastSeoForTypo3\YoastSeo\Service;
6

7
use TYPO3\CMS\Core\Page\PageRenderer;
8
use YoastSeoForTypo3\YoastSeo\Service\Javascript\JavascriptService;
9
use YoastSeoForTypo3\YoastSeo\Service\Javascript\JsonConfigService;
10
use YoastSeoForTypo3\YoastSeo\Utility\PathUtility;
11

12
class SnippetPreviewService
13
{
14
    public function __construct(
15
        protected UrlService $urlService,
16
        protected PageRenderer $pageRenderer,
17
        protected LocaleService $localeService,
18
        protected JavascriptService $javascriptService,
19
        protected JsonConfigService $jsonConfigService
NEW
20
    ) {}
×
21

22
    /**
23
     * @param array<string, mixed> $currentData
24
     * @param array<string, mixed> $additionalConfiguration
25
     */
26
    public function buildSnippetPreview(
27
        string $previewUrl,
28
        array $currentData,
29
        array $additionalConfiguration
30
    ): void {
31
        $config = [
×
32
            'urls' => [
×
NEW
33
                'workerUrl' => PathUtility::getPublicPathToResources() . '/JavaScript/dist/worker.js',
×
34
                'previewUrl' => $previewUrl,
×
35
                'saveScores' => $this->urlService->getSaveScoresUrl(),
×
36
                'prominentWords' => $this->urlService->getProminentWordsUrl(),
×
37
            ],
×
38
            'isCornerstoneContent' => (bool)($currentData['tx_yoastseo_cornerstone'] ?? false),
×
39
            'focusKeyphrase' => [
×
40
                'keyword' => (string)($currentData['tx_yoastseo_focuskeyword'] ?? ''),
×
41
                'synonyms' => (string)($currentData['tx_yoastseo_focuskeyword_synonyms'] ?? ''),
×
42
            ],
×
NEW
43
            'translations' => [$this->localeService->getTranslations()],
×
NEW
44
            'supportedLanguages' => $this->localeService->getSupportedLanguages(),
×
45
        ];
×
46

NEW
47
        $this->javascriptService->loadPluginJavascript();
×
NEW
48
        $this->javascriptService->loadModalJavascript();
×
49

NEW
50
        $this->jsonConfigService->addConfig(array_merge($config, $additionalConfiguration));
×
51

52
        $this->pageRenderer->addCssFile('EXT:yoast_seo/Resources/Public/CSS/yoast.min.css');
×
53
    }
54
}
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