src/Viserio/Component/Container/Container.php
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);
        };
    }
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);
        };
    }
Format a class binding.

@param \Closure|object|string $implementation
@param \ReflectionClass       $parameterClass

@return mixed