• 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/Form/Element/FocusKeywordAnalysis.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace YoastSeoForTypo3\YoastSeo\Form\Element;
6

7
use TYPO3\CMS\Backend\Form\AbstractNode;
8
use TYPO3\CMS\Core\Utility\GeneralUtility;
9
use YoastSeoForTypo3\YoastSeo\Service\Form\NodeTemplateService;
10
use YoastSeoForTypo3\YoastSeo\Utility\YoastUtility;
11

12
class FocusKeywordAnalysis extends AbstractNode
13
{
14
    // TODO: Use constructor DI when TYPO3 v11 can be dropped
15
    protected NodeTemplateService $templateService;
16

17
    /**
18
     * @return array<string, mixed>
19
     */
20
    public function render(): array
21
    {
NEW
22
        $this->init();
×
23
        $resultArray = $this->initializeResultArray();
×
24

NEW
25
        if ($this->data['tableName'] === 'pages'
×
NEW
26
            && !in_array((int)($this->data['databaseRow']['doktype'][0] ?? 0), YoastUtility::getAllowedDoktypes())) {
×
NEW
27
            $resultArray['html'] = $this->templateService->renderView('FocusKeywordAnalysis', ['wrongDoktype' => true]);
×
NEW
28
            return $resultArray;
×
29
        }
30

NEW
31
        if ($focusKeywordField = $this->getFocusKeywordField()) {
×
NEW
32
            $focusKeywordField = $this->getFieldSelector($focusKeywordField);
×
33
        }
34

35
        $subtype = '';
×
36
        if ($this->data['tableName'] === 'tx_yoastseo_related_focuskeyword') {
×
37
            $subtype = 'rk' . $this->data['vanillaUid'];
×
38
        }
39

NEW
40
        $resultArray['html'] = $this->templateService->renderView('FocusKeywordAnalysis', [
×
NEW
41
            'focusKeywordField' => $focusKeywordField,
×
NEW
42
            'subtype' => $subtype,
×
NEW
43
        ]);
×
44
        return $resultArray;
×
45
    }
46

47
    protected function getFocusKeywordField(): ?string
48
    {
NEW
49
        if (!empty($this->data['parameterArray']['fieldConf']['config']['settings']['focusKeywordField'] ?? '')) {
×
50
            return $this->data['parameterArray']['fieldConf']['config']['settings']['focusKeywordField'];
×
51
        }
52
        return null;
×
53
    }
54

55
    protected function getFieldSelector(string $field): string
56
    {
57
        $uid = $this->data['vanillaUid'];
×
58

59
        return 'data[' . $this->data['tableName'] . '][' . $uid . '][' . $field . ']';
×
60
    }
61

62
    protected function init(): void
63
    {
NEW
64
        $this->templateService = GeneralUtility::makeInstance(NodeTemplateService::class);
×
65
    }
66
}
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