public static function createApp(
        string $appPath,
        string $environment,
        bool $debug
    ): BaseKernel {
        $envPath = $appPath.'/.env';
        if (file_exists($envPath)) {
            $dotenv = new Dotenv();
            $dotenv->load($envPath);
        }

        $oneBundleAppConfig = new \OneBundleApp\App\OneBundleAppConfig($appPath, $environment);
        \Symfony\Component\Debug\ErrorHandler::register();
        \Symfony\Component\Debug\ExceptionHandler::register();

        return new \Mmoreram\BaseBundle\Kernel\BaseKernel(
            $oneBundleAppConfig->getBundles(),
            $oneBundleAppConfig->getConfig(),
            $oneBundleAppConfig->getRoutes(),
            $environment,
            $debug,
            $appPath.'/var'
        );
    }