trait InfersBoundHelperCalls

internal  
 

Traits

Methods

Type|null
getUnpackedHelperType(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope, Type|null $defaultType = null)

Get the type of a helper call whose unpacked lists may all be empty, leaving the first parameter at its default.

Type
getBoundHelperType(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope, string $contract, Closure $boundType)

Get the helper's declared return type for the call, with the contract it resolves replaced by the booted binding.

Details

protected Type|null getUnpackedHelperType(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope, Type|null $defaultType = null)

Get the type of a helper call whose unpacked lists may all be empty, leaving the first parameter at its default.

Returns null when the call is not of that form, so the declared return type applies.

Parameters

FunctionReflection $functionReflection
FuncCall $functionCall
Scope $scope
Type|null $defaultType

Return Value

Type|null

at line 31
protected Type getBoundHelperType(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope, string $contract, Closure $boundType)

Get the helper's declared return type for the call, with the contract it resolves replaced by the booted binding.

The declared conditional return already describes which arguments return the contract, including an explicit null, named and maybe-null arguments. Unpacked lists that may be empty also return it.

Parameters

FunctionReflection $functionReflection
FuncCall $functionCall
Scope $scope
string $contract
Closure $boundType

called only when the call can return the contract

Return Value

Type