protected function contextualBindingFormat($implementation, ReflectionClass $parameterClass)
    {
        if ($implementation instanceof Closure || $implementation instanceof $parameterClass->name) {
            return $implementation;
        }

        return static function (ContainerContract $container) use ($implementation) {
            return $container->resolve($implementation);
        };
    }