ConfigHelper
class ConfigHelper
| internal |
Constants
| private METHODS |
The repository and Config facade methods whose return types come from config values. |
Methods
Create a new helper instance.
Get the type a config lookup's value has, or null when the declared type applies.
Get the type a repository or Config facade method returns, or null when the declared type applies.
Get the name of the standard repository or Config facade value method the call makes on the application's configuration, or null when it calls another method, a custom implementation, or a repository that may not be the application's.
Determine whether the method is one of the standard repository's, its contract's or the Config facade's value methods. A custom implementation keeps its declared return type.
Get the type a typed getter requires its value to have.
Details
at line 64
__construct(ConfigParser $configParser, RuntimeInputs $runtimeInputs, WorkerStateHelper $workerStateHelper)
Create a new helper instance.
at line 80
Type|null
getValueType(CallLike $call, Scope $scope)
Get the type a config lookup's value has, or null when the declared type applies.
A present key gives its value, even when null, so a default cannot hide an incompatible value. An absent key gives the default, or null without one. Only a Closure default is called, as value() does.
at line 147
Type|null
getMethodReturnType(CallLike $call, Scope $scope)
Get the type a repository or Config facade method returns, or null when the declared type applies.
The typed getters throw for a value of another type, so a value that never has the getter's type gives an error type, which ConfigTypeRule and ConfigCollectionRule report.
at line 181
string|null
getMethodName(CallLike $call, Scope $scope)
Get the name of the standard repository or Config facade value method the call makes on the application's configuration, or null when it calls another method, a custom implementation, or a repository that may not be the application's.
at line 264
bool
isConfigMethod(MethodReflection $method)
Determine whether the method is one of the standard repository's, its contract's or the Config facade's value methods. A custom implementation keeps its declared return type.
at line 273
Type
getGetterType(string $methodName)
Get the type a typed getter requires its value to have.