<?php

declare(strict_types=1);

use System\Environment\Environment;

if (!function_exists('env')) {

    function env(string $key, mixed $default = null): mixed
    {
        return Environment::get($key, $default);
    }
if (!function_exists('config')) {

    function config(
        string $key,
        mixed $default = null
    ): mixed {

        return \System\Configuration\Config::get(
            $key,
            $default
        );
    }
if (!function_exists('app')) {
    function app(): \System\Application\Application
    {
        static $app = null;

        if ($app === null) {
            $app = require BASE_PATH . '/bootstrap/app.php';
        }

        return $app;
    }
}
}
}