class ConfigHelper

internal  
 

Constants

private METHODS

The repository and Config facade methods whose return types come from config values.

Methods

__construct(ConfigParser $configParser, RuntimeInputs $runtimeInputs, WorkerStateHelper $workerStateHelper)

Create a new helper instance.

Type|null
getValueType(CallLike $call, Scope $scope)

Get the type a config lookup's value has, or null when the declared type applies.

Type|null
getMethodReturnType(CallLike $call, Scope $scope)

Get the type a repository or Config facade method returns, or null when the declared type applies.

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.

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.

Type
getGetterType(string $methodName)

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.

Parameters

ConfigParser $configParser
RuntimeInputs $runtimeInputs
WorkerStateHelper $workerStateHelper

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.

Parameters

CallLike $call
Scope $scope

Return Value

Type|null

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.

Parameters

CallLike $call
Scope $scope

Return Value

Type|null

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.

Parameters

CallLike $call
Scope $scope

Return Value

string|null

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.

Parameters

MethodReflection $method

Return Value

bool

at line 273
Type getGetterType(string $methodName)

Get the type a typed getter requires its value to have.

Parameters

string $methodName

Return Value

Type