public static function extendViewFactory(
        ContainerInterface $container,
        ?FactoryContract $view = null
    ): ?FactoryContract {
        if ($view !== null) {
            // @var FactoryContract $view
            $view->addExtension('twig', 'twig');
        }

        return $view;
    }