<?php

namespace KupShop\ContentBundle;

use KupShop\ContentBundle\DependencyInjection\Compiler\PagePass;
use KupShop\ContentBundle\Page\PageInterface;
use KupShop\ContentBundle\Sitemap\SitemapInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class ContentBundle extends Bundle
{
    public function build(ContainerBuilder $container)
    {
        $container->registerForAutoconfiguration(PageInterface::class)
            ->addTag('kupshop.page')
            ->setPublic(false)
            ->setAutowired(true);

        $container->registerForAutoconfiguration(SitemapInterface::class)
            ->addTag('kupshop.sitemap')
            ->setPublic(false)
            ->setAutowired(true);

        $container->addCompilerPass(new PagePass());
    }
}
