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

FluidTYPO3 / vhs / 28228819034

26 Jun 2026 09:13AM UTC coverage: 69.98% (-1.3%) from 71.316%
28228819034

push

github

NamelessCoder
[REMOVAL] Drop support for TYPO3v10 and v11

4816 of 6882 relevant lines covered (69.98%)

8.17 hits per line

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

75.0
/Classes/ViewHelpers/Context/GetViewHelper.php
1
<?php
2
namespace FluidTYPO3\Vhs\ViewHelpers\Context;
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 FluidTYPO3\Vhs\Core\ViewHelper\AbstractViewHelper;
12
use TYPO3\CMS\Core\Core\Environment;
13
use TYPO3\CMS\Core\Utility\GeneralUtility;
14
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
15

16
/**
17
 * ### Context: Get
18
 *
19
 * Returns the current application context which may include possible sub-contexts.
20
 * The application context can be 'Production', 'Development' or 'Testing'.
21
 * Additionally each context can be extended with custom sub-contexts like: 'Production/Staging' or
22
 * 'Production/Staging/Server1'. If no application context has been set by the configuration, then the
23
 * default context is 'Production'.
24
 *
25
 * #### Note about how to set the application context
26
 *
27
 * The context TYPO3 CMS runs in is specified through the environment variable TYPO3_CONTEXT.
28
 * It can be set by .htaccess or in the server configuration
29
 *
30
 * See: http://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Bootstrapping/Index.html#bootstrapping-context
31
 */
32
class GetViewHelper extends AbstractViewHelper
33
{
34
    /**
35
     * @var boolean
36
     */
37
    protected $escapeOutput = false;
38

39
    /**
40
     * @param array $arguments
41
     * @param \Closure $renderChildrenClosure
42
     * @param RenderingContextInterface $renderingContext
43
     * @return string
44
     */
45
    public static function renderStatic(
46
        array $arguments,
47
        \Closure $renderChildrenClosure,
48
        RenderingContextInterface $renderingContext
49
    ) {
50
        $context = class_exists(Environment::class)
4✔
51
            ? Environment::getContext()
4✔
52
            : GeneralUtility::getApplicationContext();
×
53
        return (string) ($context);
4✔
54
    }
55
}
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