<commit_before><?php

/*
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 */

namespace Alcohol\PasteBundle;

use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\MonologBundle\MonologBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Debug\Debug;
use Symfony\Component\HttpKernel\Kernel;

class Application extends Kernel
{
    /** @var string */
    protected $name = 'Pastebin';

    /**
     * @inheritDoc
     *
     * @throws \RuntimeException
     */
    public function __construct($environment, $debug)
    {
        if (!in_array($environment, ['test', 'dev', 'prod'], true)) {
            throw new \RuntimeException('Unsupported environment: ' . $environment);
        }

        parent::__construct($environment, $debug);

        if ($this->isDebug()) {
            Debug::enable();
        }
    }

    public function registerBundles()
    {
        return [
            /* 3rd party bundles */
            new FrameworkBundle(),
            new MonologBundle(),
            /* the application's "bundle" class */
            new Bundle(),
        ];
    }

    /**
     * @inheritDoc
     *
     * @throws \RuntimeException
     */
    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $config = sprintf('%s/config/config.%s.yml', __DIR__, $this->getEnvironment());

        if (!is_readable($config)) {
            throw new \RuntimeException('Missing file: ' . $config);
        }

        $loader->load($config);
    }

    public function getRootDir()
    {
        return dirname(__DIR__);
    }

    public function getCacheDir()
    {
        return $this->rootDir . '/var/cache/' . $this->environment;
    }

    public function getLogDir()
    {
        return $this->rootDir . '/var/log/' . $this->environment;
    }
}
<commit_msg>better error message<commit_after><?php

/*
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 */

namespace Alcohol\PasteBundle;

use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\MonologBundle\MonologBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Debug\Debug;
use Symfony\Component\HttpKernel\Kernel;

class Application extends Kernel
{
    /** @var string */
    protected $name = 'Pastebin';

    /**
     * @inheritDoc
     *
     * @throws \RuntimeException
     */
    public function __construct($environment, $debug)
    {
        if (!in_array($environment, ['test', 'dev', 'prod'], true)) {
            throw new \RuntimeException('Unsupported environment: ' . $environment);
        }

        parent::__construct($environment, $debug);

        if ($this->isDebug()) {
            Debug::enable();
        }
    }

    public function registerBundles()
    {
        return [
            /* 3rd party bundles */
            new FrameworkBundle(),
            new MonologBundle(),
            /* the application's "bundle" class */
            new Bundle(),
        ];
    }

    /**
     * @inheritDoc
     *
     * @throws \RuntimeException
     */
    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $config = sprintf('%s/config/config.%s.yml', __DIR__, $this->getEnvironment());

        if (!is_readable($config)) {
            throw new \RuntimeException('Cannot read configuration from: ' . $config);
        }

        $loader->load($config);
    }

    public function getRootDir()
    {
        return dirname(__DIR__);
    }

    public function getCacheDir()
    {
        return $this->rootDir . '/var/cache/' . $this->environment;
    }

    public function getLogDir()
    {
        return $this->rootDir . '/var/log/' . $this->environment;
    }
}

{'fraction_non_alphanumeric': 0.13146496815286624, 'fraction_numerical': 0.0005095541401273885, 'mean_word_length': 2.3243014394580865, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, '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': '5141314', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1070, 'n_words': 248}