• 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/Form/Element/SnippetPreview.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\Form\Element;
13

14
use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction;
15
use YoastSeoForTypo3\YoastSeo\Service\Form\NodeTemplateService;
16
use YoastSeoForTypo3\YoastSeo\Service\LocaleService;
17
use YoastSeoForTypo3\YoastSeo\Service\SnippetPreview\SnippetPreviewConfigurationBuilder;
18
use YoastSeoForTypo3\YoastSeo\Service\SnippetPreview\SnippetPreviewRequestDataGenerator;
19
use YoastSeoForTypo3\YoastSeo\Service\SnippetPreviewService;
20
use YoastSeoForTypo3\YoastSeo\Utility\YoastUtility;
21

22
class SnippetPreview extends AbstractLabeledFormElement
23
{
24
    public function __construct(
25
        protected NodeTemplateService $templateService,
26
        protected SnippetPreviewConfigurationBuilder $configurationBuilder,
27
        protected SnippetPreviewRequestDataGenerator $requestDataGenerator,
28
        protected SnippetPreviewService $snippetPreviewService,
29
        protected LocaleService $localeService,
NEW
30
    ) {}
×
31

32
    /**
33
     * @param array<string, mixed> $data
34
     */
35
    public function setData(array $data): void
36
    {
NEW
37
        $this->data = $data;
×
38
    }
39

40
    /**
41
     * @return array<string, mixed>
42
     */
43
    public function render(): array
44
    {
45
        if ($this->data['command'] === 'new') {
×
46
            return [];
×
47
        }
48

49
        $resultArray = $this->initializeResultArray();
×
UNCOV
50
        $resultArray['stylesheetFiles'][] = 'EXT:yoast_seo/Resources/Public/CSS/yoast.min.css';
×
51

NEW
52
        if ($this->data['tableName'] === 'pages' && !in_array(
×
NEW
53
            (int)($this->data['databaseRow']['doktype'][0] ?? 0),
×
NEW
54
            YoastUtility::getAllowedDoktypes(),
×
NEW
55
            true
×
NEW
56
        )) {
×
57
            $resultArray['html'] = $this->templateService->renderView('SnippetPreview', ['wrongDoktype' => true]);
×
58
            return $resultArray;
×
59
        }
60

NEW
61
        $snippetPreviewConfiguration = $this->configurationBuilder->buildConfigurationForTCA(
×
NEW
62
            $this->data,
×
NEW
63
            $this->localeService->getLanguageIdFromData($this->data)
×
NEW
64
        );
×
65

NEW
66
        $this->snippetPreviewService->buildSnippetPreview(
×
NEW
67
            $this->requestDataGenerator->getRequestData($this->data),
×
NEW
68
            $this->data['databaseRow'],
×
NEW
69
            $snippetPreviewConfiguration
×
NEW
70
        );
×
71

72
        // Also load the javascript for cornerstone and progress bars
NEW
73
        $resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@yoast/yoast-seo-for-typo3/cornerstone.js');
×
NEW
74
        $resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@yoast/yoast-seo-for-typo3/title-description.js');
×
75

NEW
76
        $resultArray['html'] = $this->getLabel() . $this->templateService->renderView('SnippetPreview');
×
77

NEW
78
        return $resultArray;
×
79
    }
80
}
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