<?php

/*
 * This file is part of the Fidry\Console package.
 *
 * (c) Théo FIDRY <theo.fidry@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
declare (strict_types=1);
namespace ReloadifyScoped\Fidry\Console;

use ReloadifyScoped\Fidry\Console\DependencyInjection\Compiler\AddConsoleCommandPass;
use ReloadifyScoped\Fidry\Console\DependencyInjection\FidryConsoleExtension;
use ReloadifyScoped\Symfony\Component\DependencyInjection\Compiler\PassConfig;
use ReloadifyScoped\Symfony\Component\DependencyInjection\ContainerBuilder;
use ReloadifyScoped\Symfony\Component\HttpKernel\Bundle\Bundle;
use ReloadifyScoped\Symfony\Component\HttpKernel\DependencyInjection\Extension;
final class FidryConsoleBundle extends Bundle
{
    public function getContainerExtension() : Extension
    {
        return new FidryConsoleExtension();
    }
    public function build(ContainerBuilder $container) : void
    {
        parent::build($container);
        $container->addCompilerPass(
            new AddConsoleCommandPass(),
            PassConfig::TYPE_BEFORE_REMOVING,
            // Priority must be higher than Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass in FrameworkBundle
            10
        );
    }
}
