class RelationConditionableCallbackExtension implements MethodParameterClosureTypeExtension

internal  
 

Gives the callbacks of a relation's when() and unless() their builder as a "this" type.

Relation::__call() returns the relation only when the call returns the relation's own builder. Fluent calls keep a "this" type, while a clone or another query of the same class loses it, so ConditionableExpressionTypeResolverExtension can tell a callback that returns the builder it was given from one that returns a different builder.

Methods

bool
isMethodSupported(MethodReflection $methodReflection, ParameterReflection $parameter)

Determine whether the parameter is a callback of a when() or unless() call a relation forwards.

Type
getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, ParameterReflection $parameter, Scope $scope)

Return the callback type with the builder it receives as a "this" type.

Details

at line 41
bool isMethodSupported(MethodReflection $methodReflection, ParameterReflection $parameter)

Determine whether the parameter is a callback of a when() or unless() call a relation forwards.

Parameters

MethodReflection $methodReflection
ParameterReflection $parameter

Return Value

bool

at line 52
Type getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, ParameterReflection $parameter, Scope $scope)

Return the callback type with the builder it receives as a "this" type.

Parameters

MethodReflection $methodReflection
MethodCall $methodCall
ParameterReflection $parameter
Scope $scope

Return Value

Type