NoEnvCallsOutsideOfConfigRule
class NoEnvCallsOutsideOfConfigRule implements Rule
Catches environment reads outside of the config directory.
Upstream matches only env(), which Env::get() and the other readers bypass, so every env helper and Env reader is matched here. Raw repository, getenv() and superglobal access are deliberate low-level reads and are not.
Constants
| private FUNCTIONS |
The global helpers that read the environment, including app_id(), which supplies config defaults. |
| private METHODS |
The Env methods that read a variable, lowercased. |
Methods
__construct(ConfigSourceResolver $configSourceResolver, ReflectionProvider $reflectionProvider, RuntimeInputs $runtimeInputs)
Create a new env calls rule instance.
string
getNodeType()
Get the node type the rule checks.
array
processNode(Node $node, Scope $scope)
Report environment reads outside of config files.
Details
at line 54
__construct(ConfigSourceResolver $configSourceResolver, ReflectionProvider $reflectionProvider, RuntimeInputs $runtimeInputs)
Create a new env calls rule instance.
at line 64
string
getNodeType()
Get the node type the rule checks.
at line 77
array
processNode(Node $node, Scope $scope)
Report environment reads outside of config files.