DependencyResolver is a dependency injection implementation.

Protected Properties

protected Container $container

container for application

Public Methods

public __construct()

public __construct(): void

__construct instance

public resolve()

public resolve($instance, $method, $parameters): void

public resolveMethodDependencies()

public resolveMethodDependencies(
    array $parameters,
    ReflectionFunctionAbstract $reflector
): array 

Resolve the given method's type-hinted dependencies.

Protected Methods

protected alreadyInParameters()

protected alreadyInParameters(string $class, array $parameters): bool 

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

protected resolveClassMethodDependencies()

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

Resolve the object method's type-hinted dependencies.

protected spliceIntoParameters()

protected spliceIntoParameters(
    array &$parameters,
    string $offset,
    mixed $value
): void 

Splice the given value into the parameter list.

protected transformDependency()

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

Attempt to transform the given parameter into a class instance.