#!/usr/bin/env php
<?php
// @link https://www.tomasvotruba.cz/blog/2018/08/02/5-gotchas-of-the-bin-file-in-php-cli-applications/

gc_disable(); // performance boost

require_once dirname(__DIR__) . '/config/bootstrap.php';

use Bartlett\CompatInfoDb\Presentation\Console\ApplicationInterface;

use Symfony\Component\Console\CommandLoader\CommandLoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

/** @var ContainerBuilder $container */
$container = require dirname(__DIR__) . '/config/container.php';

/** @var ApplicationInterface $app */
$app = $container->get(ApplicationInterface::class);
$app->setContainer($container);

// @link https://symfony.com/doc/current/console/lazy_commands.html
$app->setCommandLoader($container->get(CommandLoaderInterface::class));

exit($app->run());
