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

FluidTYPO3 / vhs / 29999067194

23 Jul 2026 10:22AM UTC coverage: 70.309% (-0.5%) from 70.857%
29999067194

push

github

NamelessCoder
[FEATURE] Declare support for TYPO3v14

6 of 8 new or added lines in 3 files covered. (75.0%)

50 existing lines in 2 files now uncovered.

4819 of 6854 relevant lines covered (70.31%)

6.54 hits per line

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

68.75
/Classes/Utility/ContentObjectFetcher.php
1
<?php
2
namespace FluidTYPO3\Vhs\Utility;
3

4
/*
5
 * This file is part of the FluidTYPO3/Vhs project under GPLv2 or later.
6
 *
7
 * For the full copyright and license information, please read the
8
 * LICENSE.md file that was distributed with this source code.
9
 */
10

11
use Psr\Http\Message\ServerRequestInterface;
12
use TYPO3\CMS\Core\Utility\GeneralUtility;
13
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
14
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
15

16
class ContentObjectFetcher
17
{
18
    public static function resolve(?ConfigurationManagerInterface $configurationManager = null): ContentObjectRenderer
19
    {
20
        $contentObject = null;
24✔
21
        $request = ($configurationManager !== null && method_exists($configurationManager, 'getRequest')
24✔
UNCOV
22
            ? $configurationManager->getRequest()
×
23
            : ($GLOBALS['TYPO3_REQUEST'] ?? null)) ?? $GLOBALS['TYPO3_REQUEST'] ?? null;
24✔
24

25
        if ($request instanceof ServerRequestInterface) {
24✔
26
            /** @var ContentObjectRenderer|null $contentObject */
27
            $contentObject = $request->getAttribute('currentContentObject');
24✔
28
        }
29

30
        if ($contentObject === null && VersionUtility::isCoreBelow14()) {
24✔
UNCOV
31
            $controller = RequestResolver::getTypoScriptFrontendController();
×
UNCOV
32
            $contentObject = $controller?->cObj ?? null;
×
33
        }
34

35
        if ($contentObject === null
24✔
36
            && $configurationManager !== null
24✔
37
            && method_exists($configurationManager, 'getContentObject')
24✔
38
        ) {
39
            $contentObject = $configurationManager->getContentObject();
×
40
        }
41

42
        if (!$contentObject) {
24✔
43
            /** @var ContentObjectRenderer $contentObject */
44
            $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class);
×
45
        }
46

47
        return $contentObject;
24✔
48
    }
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc