#!/usr/bin/env php
<?php declare(strict_types=1);

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\DependencyInjection\Container;
use Symplify\EasyCodingStandard\Console\Application;
use Symplify\PackageBuilder\Console\Style\SymfonyStyleFactory;

// performance boost
gc_disable();

try {
    /** @var Container $container */
    $container = require __DIR__ . '/vendor/symplify/easy-coding-standard/bin/ecs-container.php';

    /** @var Application $application */
    $application = $container->get(Application::class);

    /** @var InputInterface $input */
    $input = $container->get(InputInterface::class);

    /** @var OutputInterface $output */
    $output = $container->get(OutputInterface::class);
    exit($application->run($input, $output));
} catch (Throwable $throwable) {
    $symfonyStyle = SymfonyStyleFactory::create();
    $symfonyStyle->error($throwable->getMessage());
    exit(1);
}
