You've already forked Php-Template
initial
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Siteworxpro\App\Helpers;
|
||||
|
||||
use Psr\Log\LogLevel;
|
||||
use Siteworxpro\App\Facades\Config as FacadeConfig;
|
||||
|
||||
class Config
|
||||
{
|
||||
private const array DEFAULTS = [
|
||||
FacadeConfig::DB_DRIVER => 'pgsql',
|
||||
FacadeConfig::DB_HOST => 'localhost',
|
||||
FacadeConfig::DB_DATABASE => 'siteworx',
|
||||
FacadeConfig::DB_USER => 'siteworx',
|
||||
FacadeConfig::DB_PASSWORD => 'password',
|
||||
FacadeConfig::LOG_LEVEL => LogLevel::DEBUG,
|
||||
FacadeConfig::HTTP_PORT => '9501',
|
||||
FacadeConfig::DEV_MODE => true,
|
||||
];
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @param string $castTo
|
||||
* @return string|int|bool|float
|
||||
*/
|
||||
public function get(string $key, string $castTo = 'string'): string|int|bool|float
|
||||
{
|
||||
return Env::get($key, self::DEFAULTS[$key] ?? null, $castTo);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user