Total Complexity | 3 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
10 | class PluginConfigurationHelpers |
||
11 | { |
||
12 | /** |
||
13 | * Determine if the environment variable was defined |
||
14 | * as a constant in wp-config.php |
||
15 | * |
||
16 | * @return mixed |
||
17 | */ |
||
18 | public static function getWPConfigConstantValue(string $envVariable) |
||
19 | { |
||
20 | return constant(self::getWPConfigConstantName($envVariable)); |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Determine if the environment variable was defined |
||
25 | * as a constant in wp-config.php |
||
26 | */ |
||
27 | public static function isWPConfigConstantDefined(string $envVariable): bool |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Constants defined in wp-config.php must start with this prefix |
||
34 | * to override GraphQL API environment variables |
||
35 | */ |
||
36 | public static function getWPConfigConstantName(string $envVariable): string |
||
39 | } |
||
40 | } |
||
41 |