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

FluidTYPO3 / flux / 27753814608

18 Jun 2026 10:39AM UTC coverage: 89.162% (-3.5%) from 92.646%
27753814608

Pull #2288

github

web-flow
Merge 37edf9f2e into 2614049c6
Pull Request #2288: [FEATURE] Prepare for v14 support

210 of 348 new or added lines in 56 files covered. (60.34%)

121 existing lines in 9 files now uncovered.

6228 of 6985 relevant lines covered (89.16%)

40.84 hits per line

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

53.85
/Classes/Utility/RequestResolver.php
1
<?php
2
namespace FluidTYPO3\Flux\Utility;
3

4
/*
5
 * This file is part of the FluidTYPO3/Flux 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\Authentication\BackendUserAuthentication;
13
use TYPO3\CMS\Core\Site\Entity\SiteLanguage;
14
use TYPO3\CMS\Core\Utility\GeneralUtility;
15
use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication;
16
use TYPO3\CMS\Frontend\Page\PageInformation;
17

18
class RequestResolver
19
{
20
    public static function getRequest(): ServerRequestInterface
21
    {
22
        /** @var ServerRequestInterface|null $request */
23
        $request = $GLOBALS['TYPO3_REQUEST'] ?? null;
3✔
24
        if (!$request) {
3✔
NEW
25
            throw new \UnexpectedValueException('Request cannot be resolved', 1777024778);
×
26
        }
27
        return $request;
3✔
28
    }
29

30
    public static function getPageInformation(): PageInformation
31
    {
32
        /** @var PageInformation $pageInformation */
33
        $pageInformation = GeneralUtility::makeInstance(PageInformation::class, self::getRequest());
3✔
34
        return $pageInformation;
3✔
35
    }
36

37
    public static function getLanguage(): SiteLanguage
38
    {
39
        /** @var SiteLanguage $siteLanguage */
NEW
40
        $siteLanguage = self::getRequest()->getAttribute('language');
×
NEW
41
        return $siteLanguage;
×
42
    }
43

44
    public static function getFrontendUser(): ?FrontendUserAuthentication
45
    {
46
        /** @var FrontendUserAuthentication $frontendUser */
NEW
47
        $frontendUser = self::getRequest()->getAttribute('frontend.user');
×
NEW
48
        return $frontendUser;
×
49
    }
50

51
    public static function getBackendUser(): ?BackendUserAuthentication
52
    {
53
        /** @var BackendUserAuthentication|null $backendUser */
54
        $backendUser = $GLOBALS['BE_USER'] ?? null;
12✔
55
        return $backendUser;
12✔
56
    }
57

58
    public static function isFrontendUserLoggedIn(): bool
59
    {
NEW
60
        return self::getFrontendUser() !== null;
×
61
    }
62
}
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