trait ResolvesRouteDependencies

Properties

static protected array<string, bool> $enumCache

Cached isEnum results keyed by class name.

Methods

static void
flushEnumCache()

Flush the static enum cache.

array
resolveClassMethodDependencies(array $parameters, object $instance, string $method)

Resolve the object method's type-hinted dependencies.

array
resolveMethodDependencies(array $parameters, array $reflectedParameters)

Resolve the given method's type-hinted dependencies.

mixed
transformDependency(ReflectionParameter $parameter, array $parameters, object $skippableValue)

Attempt to transform the given parameter into a class instance.

bool
alreadyInParameters(string $class, array $parameters)

Determine if an object of the given class is in a list of parameters.

void
spliceIntoParameters(array $parameters, int $offset, mixed $value)

Splice the given value into the parameter list.

Details

at line 33
static void flushEnumCache()

Flush the static enum cache.

Boot or tests only. Clears the process-wide enum lookup cache shared by every coroutine; next resolution re-resolves.

Return Value

void

at line 41
protected array resolveClassMethodDependencies(array $parameters, object $instance, string $method)

Resolve the object method's type-hinted dependencies.

Parameters

array $parameters
object $instance
string $method

Return Value

array

at line 58
array resolveMethodDependencies(array $parameters, array $reflectedParameters)

Resolve the given method's type-hinted dependencies.

Parameters

array $parameters
array $reflectedParameters

Return Value

array

at line 87
protected mixed transformDependency(ReflectionParameter $parameter, array $parameters, object $skippableValue)

Attempt to transform the given parameter into a class instance.

Parameters

ReflectionParameter $parameter
array $parameters
object $skippableValue

Return Value

mixed

at line 112
protected bool alreadyInParameters(string $class, array $parameters)

Determine if an object of the given class is in a list of parameters.

Parameters

string $class
array $parameters

Return Value

bool

at line 120
protected void spliceIntoParameters(array $parameters, int $offset, mixed $value)

Splice the given value into the parameter list.

Parameters

array $parameters
int $offset
mixed $value

Return Value

void