Completed
Push — master ( abb405...0346f6 )
by
unknown
18:42 queued 02:27
created

EnvironmentService::getServerRequestMethod()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 1
nc 4
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the TYPO3 CMS project.
7
 *
8
 * It is free software; you can redistribute it and/or modify it under
9
 * the terms of the GNU General Public License, either version 2
10
 * of the License, or any later version.
11
 *
12
 * For the full copyright and license information, please read the
13
 * LICENSE.txt file that was distributed with this source code.
14
 *
15
 * The TYPO3 project - inspiring people to share!
16
 */
17
18
namespace TYPO3\CMS\Extbase\Service;
19
20
use TYPO3\CMS\Core\SingletonInterface;
21
22
/**
23
 * Service for determining environment params
24
 * @internal only to be used within Extbase, not part of TYPO3 Core API.
25
 */
26
class EnvironmentService implements SingletonInterface
27
{
28
    /**
29
     * Detects if TYPO3_MODE is defined and its value is "FE"
30
     *
31
     * @return bool
32
     */
33
    public function isEnvironmentInFrontendMode(): bool
34
    {
35
        return (defined('TYPO3_MODE') && TYPO3_MODE === 'FE') ?: false;
0 ignored issues
show
introduced by
The condition TYPO3\CMS\Extbase\Service\TYPO3_MODE === 'FE' is always false.
Loading history...
36
    }
37
38
    /**
39
     * Detects if TYPO3_MODE is defined and its value is "BE"
40
     *
41
     * @return bool
42
     */
43
    public function isEnvironmentInBackendMode(): bool
44
    {
45
        return (defined('TYPO3_MODE') && TYPO3_MODE === 'BE') ?: false;
46
    }
47
}
48