‪TYPO3CMS  ‪main
EnvVarProcessor.php
Go to the documentation of this file.
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 
19 
20 use Symfony\Component\DependencyInjection\EnvVarProcessorInterface;
22 
26 class ‪EnvVarProcessor implements EnvVarProcessorInterface
27 {
34  public function ‪getEnv(string $prefix, string $name, \Closure $getEnv): mixed
35  {
36  $callable = [Environment::class, 'get' . ucfirst($name)];
37  if (!is_callable($callable)) {
38  $callable = [Environment::class, 'is' . ucfirst($name)];
39  if (!is_callable($callable)) {
40  throw new \RuntimeException('Environment ' . $name . ' not available in ' . Environment::class, 1562314987);
41  }
42  }
43  return $callable();
44  }
45 
49  public static function ‪getProvidedTypes(): array
50  {
51  return [
52  'TYPO3' => 'string|bool',
53  ];
54  }
55 }
‪TYPO3\CMS\Core\DependencyInjection\EnvVarProcessor\getProvidedTypes
‪static string[] getProvidedTypes()
Definition: EnvVarProcessor.php:49
‪TYPO3\CMS\Core\DependencyInjection\EnvVarProcessor\getEnv
‪getEnv(string $prefix, string $name, \Closure $getEnv)
Definition: EnvVarProcessor.php:34
‪TYPO3\CMS\Core\DependencyInjection
Definition: AutowireInjectMethodsPass.php:18
‪TYPO3\CMS\Core\DependencyInjection\EnvVarProcessor
Definition: EnvVarProcessor.php:27
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:41