BuilderMacroResolver
class BuilderMacroResolver
Resolve the builder macros that model traits add through their global scopes.
Packages map each trait to an interface declaring its macros through the eloquentBuilderMacros parameter. A generic interface receives the model type.
Methods
Create a builder macro resolver.
Determine whether the model's traits add the named builder macro.
Resolve a trait macro called on a builder for the given model type.
Details
at line 36
__construct(ReflectionProvider $reflectionProvider, array $macros)
Create a builder macro resolver.
at line 47
bool
hasMacro(ClassReflection $modelClass, string $methodName)
Determine whether the model's traits add the named builder macro.
at line 58
MethodReflection|null
resolve(ClassReflection $builderClass, Type $modelType, Type $signatureModelType, string $methodName)
Resolve a trait macro called on a builder for the given model type.
The signature names the model by the signature model type, the receiver's own template type for it, so PHPStan binds the model only after replacing the receiver's static types.