<commit_before><?php

namespace Pongtan;

use Dotenv\Dotenv;
use Illuminate\Filesystem\Filesystem;
use Pongtan\Services\Config;
use Slim\App as SlimApp;

class App extends SlimApp
{
    public $basePath;

    public $config;

    public $fileSystem;

    public $environment;

    /**
     * App constructor.
     * @param $bathPath
     */
    public function __construct($bathPath)
    {
        $this->setBasePath($bathPath);
        $this->init();
    }

    public function init()
    {
        $this->config = new Config();
        $this->fileSystem = new Filesystem();
        $this->environment = $this->getEnvironment();
        $this->config->loadConfigFiles($this->bathPath . '/config');
    }

    /**
     * @param $bathPath
     */
    public function setBasePath($bathPath)
    {
        $this->basePath = $bathPath;
    }

    /**
     * @return string
     * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
     */
    public function getEnvironment()
    {
        $environment = '';
        $environmentPath = $this->bathPath . '/.env';
        if ($this->fileSystem->isFile($environmentPath)) {
            $environment = trim($this->fileSystem->get($environmentPath));
            $envFile = $this->bathPath . '/.' . $environment;

            if ($this->fileSystem->isFile($envFile . '.env')) {
                $dotEnv = new Dotenv($this->bathPath . '/', '.' . $environment . '.env');
                $dotEnv->load();
            }
        }
        return $environment;
    }
}<commit_msg>fix typo<commit_after><?php

namespace Pongtan;

use Dotenv\Dotenv;
use Illuminate\Filesystem\Filesystem;
use Pongtan\Services\Config;
use Slim\App as SlimApp;

class App extends SlimApp
{
    private $basePath;

    public $config;

    public $fileSystem;

    public $environment;

    /**
     * App constructor.
     * @param $basePath
     */
    public function __construct($basePath)
    {
        $this->setBasePath($basePath);
        $this->init();
    }

    public function init()
    {
        $this->config = new Config();
        $this->fileSystem = new Filesystem();
        $this->environment = $this->getEnvironment();
        $this->config->loadConfigFiles($this->basePath . '/config');
    }

    /**
     * @param $basePath
     */
    public function setBasePath($basePath)
    {
        $this->basePath = $basePath;
    }

    /**
     * @return string
     * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
     */
    public function getEnvironment()
    {
        $environment = '';
        $environmentPath = $this->basePath . '/.env';
        if ($this->fileSystem->isFile($environmentPath)) {
            $environment = trim($this->fileSystem->get($environmentPath));
            $envFile = $this->basePath . '/.' . $environment;

            if ($this->fileSystem->isFile($envFile . '.env')) {
                $dotEnv = new Dotenv($this->basePath . '/', '.' . $environment . '.env');
                $dotEnv->load();
            }
        }
        return $environment;
    }
}
{'fraction_non_alphanumeric': 0.15278688524590164, 'fraction_numerical': 0.0, 'mean_word_length': 2.138888888888889, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '1262159', 'n_tokens_mistral': 913, 'n_tokens_neox': 897, 'n_words': 167}