public static function createUrlGenerator(ContainerInterface $container): ?UrlGeneratorContract
    {
        if (! $container->has(UriFactoryInterface::class)) {
            return null;
        }

        return new UrlGenerator(
            $container->get(RouterContract::class)->getRoutes(),
            $container->get(ServerRequestInterface::class),
            $container->get(UriFactoryInterface::class)
        );
    }
public static function createUrlGenerator(ContainerInterface $container): ?UrlGeneratorContract
    {
        if (! $container->has(UriFactoryInterface::class)) {
            return null;
        }

        return new UrlGenerator(
            $container->get(RouterContract::class)->getRoutes(),
            $container->get(ServerRequestInterface::class),
            $container->get(UriFactoryInterface::class)
        );
    }
public static function createUrlGenerator ( ContainerInterface $ container ) : ? UrlGeneratorContract { if ( ! $ container -> has ( UriFactoryInterface :: class ) ) { return null ; } return new UrlGenerator ( $ container -> get ( RouterContract :: class ) -> getRoutes ( ) , $ container -> get ( ServerRequestInterface :: class ) , $ container -> get ( UriFactoryInterface :: class ) ) ; }
Create a url generator instance.

@param \Psr\Container\ContainerInterface $container

@return null|\Viserio\Component\Contract\Routing\UrlGenerator
Create a url generator instance .