src/Loader/LazyLoading.php
private function getParameters(ReflectionClass $reflection): array
    {
        if (null === $reflection->getConstructor()) {
            return [];
        }

        $params = $reflection->getConstructor()->getParameters();
        $args = [];

        foreach ($params as $param) {
            if ($param->getClass() &&
                $param->getClass()->isInstance($this->container)
            ) {
                $args[] = $this->container;
            } elseif ($param->getClass() &&
                $this->container->has('logger.engine') &&
                $param->getClass()->implementsInterface('Psr\\Log\\LoggerInterface')
            ) {
                $args[] = $this->container->get('logger.engine');
            } elseif ($this->container->has(Router::class) &&
                $param->getClass() &&
                $param->getClass()->isInstance($this->container->get(Router::class))
            ) {
                $args[] = $this->container->get(Router::class);
            } elseif ($this->container->has(Dispatcher::class) &&
                $param->getClass() &&
                $param->getClass()->isInstance($this->container->get(Dispatcher::class))
            ) {
                $args[] = $this->container->get(Dispatcher::class);
            } elseif ($this->container->has(Response::class) &&
                $param->getClass() &&
                $param->getClass()->isInstance($this->container->get(Response::class))
            ) {
                $args[] = $this->container->get(Response::class);
            } else {
                $request = ServerRequest::fromGlobals();
                $attributes = $request->getQueryParams();

                foreach ($attributes as $name => $value) {
                    if (array_key_exists($param->getName(), $name)) {
                        if ($param->isVariadic() && is_array($value)) {
                            $args[] = array_merge($args, array_values($value));
                        } else {
                            $args[] = $value;
                        }
                    } elseif ($param->isDefaultValueAvailable()) {
                        $args[] = $param->getDefaultValue();
                    } else {
                        if ($param->hasType() && $param->allowsNull()) {
                            $args[] = null;
                        }
                    }
                } // endforeach $attributes
            } // endif $param type
        } // endforeach $params

        return $args;
    }
private function getParameters(ReflectionClass $reflection): array
    {
        if (null === $reflection->getConstructor()) {
            return [];
        }

        $params = $reflection->getConstructor()->getParameters();
        $args = [];

        foreach ($params as $param) {
            if ($param->getClass() &&
                $param->getClass()->isInstance($this->container)
            ) {
                $args[] = $this->container;
            } elseif ($param->getClass() &&
                $this->container->has('logger.engine') &&
                $param->getClass()->implementsInterface('Psr\\Log\\LoggerInterface')
            ) {
                $args[] = $this->container->get('logger.engine');
            } elseif ($this->container->has(Router::class) &&
                $param->getClass() &&
                $param->getClass()->isInstance($this->container->get(Router::class))
            ) {
                $args[] = $this->container->get(Router::class);
            } elseif ($this->container->has(Dispatcher::class) &&
                $param->getClass() &&
                $param->getClass()->isInstance($this->container->get(Dispatcher::class))
            ) {
                $args[] = $this->container->get(Dispatcher::class);
            } elseif ($this->container->has(Response::class) &&
                $param->getClass() &&
                $param->getClass()->isInstance($this->container->get(Response::class))
            ) {
                $args[] = $this->container->get(Response::class);
            } else {
                $request = ServerRequest::fromGlobals();
                $attributes = $request->getQueryParams();

                foreach ($attributes as $name => $value) {
                    if (array_key_exists($param->getName(), $name)) {
                        if ($param->isVariadic() && is_array($value)) {
                            $args[] = array_merge($args, array_values($value));
                        } else {
                            $args[] = $value;
                        }
                    } elseif ($param->isDefaultValueAvailable()) {
                        $args[] = $param->getDefaultValue();
                    } else {
                        if ($param->hasType() && $param->allowsNull()) {
                            $args[] = null;
                        }
                    }
                } // endforeach $attributes
            } // endif $param type
        } // endforeach $params

        return $args;
    }
@param ReflectionClass $reflection

@throws \Psr\Container\ContainerExceptionInterface
@throws \Psr\Container\NotFoundExceptionInterface

@return array