<commit_before><?php

namespace Quazardous\Silex\Console;

use Symfony\Component\Console\Application as BaseApplication;
use Silex\Application as SilexApplication;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class Console extends BaseApplication
{
    /**
     * @var \Silex\Application
     */
    protected $container;

    /**
     * @return \Silex\Application
     */
    public function getContainer()
    {
        return $this->container;
    }

    /**
     * @param \Silex\SilexApplication $container
     * @param string $name
     * @param string $version
     */
    public function __construct(SilexApplication $container, $name = 'UNKNOWN', $version = 'UNKNOWN')
    {
        $this->container = $container;
        parent::__construct($name, $version);
    }

    /**
     * {@inheritdoc}
     *
     * @see \Symfony\Component\Console\Application::run()
     */
    public function run(InputInterface $input = null, OutputInterface $output = null)
    {
        $this->getContainer()->boot();
        $this->getContainer()->flush();
        $exitCode = parent::run($input, $output);
        $this->getContainer()->terminate(new Request(), new Response());

        return $exitCode;
    }
}<commit_msg>disable autoExit to allow post run() stuff<commit_after><?php

namespace Quazardous\Silex\Console;

use Symfony\Component\Console\Application as BaseApplication;
use Silex\Application as SilexApplication;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class Console extends BaseApplication
{
    /**
     * @var \Silex\Application
     */
    protected $container;

    /**
     * @return \Silex\Application
     */
    public function getContainer()
    {
        return $this->container;
    }

    /**
     * @param \Silex\SilexApplication $container
     * @param string $name
     * @param string $version
     */
    public function __construct(SilexApplication $container, $name = 'UNKNOWN', $version = 'UNKNOWN')
    {
        $this->container = $container;
        parent::__construct($name, $version);
    }

    /**
     * {@inheritdoc}
     *
     * @see \Symfony\Component\Console\Application::run()
     */
    public function run(InputInterface $input = null, OutputInterface $output = null)
    {
        $this->setAutoExit(false);
        $this->getContainer()->boot();
        $this->getContainer()->flush();
        $exitCode = parent::run($input, $output);
        $this->getContainer()->terminate(new Request(), new Response());

        return $exitCode;
    }
}
{'fraction_non_alphanumeric': 0.13309608540925266, 'fraction_numerical': 0.0, 'mean_word_length': 3.0446043165467627, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1645981', 'n_tokens_mistral': 798, 'n_tokens_neox': 792, 'n_words': 161}