Config
in package
Read onlyYes
FinalYes
Wrapper class around the .env file
Table of Contents
Properties
- $airlyApiKey : string
- $airlyEndpoint : string
- $airlyLocationId : string
- $announcementDateFormat : string
- $announcementDefaultValidDate : string
- $announcementMaxTextLength : int
- $announcementMaxTitleLength : int
- $announcementMaxValidDate : string
- $announcementMinTextLength : int
- $announcementMinTitleLength : int
- $announcementTableName : string
- $countdownDateFormat : string
- $countdownMaxTitleLength : int
- $countdownTableName : string
- $googleCalendarApiKey : string
- $googleCalendarId : string
- $imgwWeatherUrl : string
- $loggingChannelName : string
- $loggingDirectoryPath : string
- $loggingLevel : string
- $maxUsernameLength : int
- $minPasswordLength : int
- $moduleDateFormat : string
- $moduleTableName : string
- $quoteApiUrl : string
- $quoteDateFormat : string
- $quoteTableName : string
- $stopID : array<string|int, mixed>
- $tramUrl : string
- $twigCachePath : string
- $twigDebug : bool
- $userDateFormat : string
- $userTableName : string
- $weatherCacheTtlSeconds : int
- $weatherDateFormat : string
- $weatherTableName : string
- $wordApiUrl : string
- $wordDateFormat : string
- $wordTableName : string
- $dbHost : string
- $dbName : string
- $dbPassword : string
- $dbPort : string
- $dbUsername : string
Methods
- dbDsn() : string
- dbPassword() : string
- dbUsername() : string
- fromEnv() : self
- __construct() : mixed
- boolEnv() : bool
- Fetches boolean variable type from .env
- fetchEnv() : string|null
- Fetches variable from .env file
- intEnv() : int
- Fetches integer variable type from .env
- optionalEnv() : string
- Returns default value if variable is not found in .env
- requiredEnv() : string
- Fetches required variable from .env and throws error if not found
Properties
$airlyApiKey
public
string
$airlyApiKey
$airlyEndpoint
public
string
$airlyEndpoint
$airlyLocationId
public
string
$airlyLocationId
$announcementDateFormat
public
string
$announcementDateFormat
$announcementDefaultValidDate
public
string
$announcementDefaultValidDate
$announcementMaxTextLength
public
int
$announcementMaxTextLength
$announcementMaxTitleLength
public
int
$announcementMaxTitleLength
$announcementMaxValidDate
public
string
$announcementMaxValidDate
$announcementMinTextLength
public
int
$announcementMinTextLength
$announcementMinTitleLength
public
int
$announcementMinTitleLength
$announcementTableName
public
string
$announcementTableName
$countdownDateFormat
public
string
$countdownDateFormat
$countdownMaxTitleLength
public
int
$countdownMaxTitleLength
$countdownTableName
public
string
$countdownTableName
$googleCalendarApiKey
public
string
$googleCalendarApiKey
$googleCalendarId
public
string
$googleCalendarId
$imgwWeatherUrl
public
string
$imgwWeatherUrl
$loggingChannelName
public
string
$loggingChannelName
$loggingDirectoryPath
public
string
$loggingDirectoryPath
$loggingLevel
public
string
$loggingLevel
$maxUsernameLength
public
int
$maxUsernameLength
$minPasswordLength
public
int
$minPasswordLength
$moduleDateFormat
public
string
$moduleDateFormat
$moduleTableName
public
string
$moduleTableName
$quoteApiUrl
public
string
$quoteApiUrl
$quoteDateFormat
public
string
$quoteDateFormat
$quoteTableName
public
string
$quoteTableName
$stopID
public
array<string|int, mixed>
$stopID
$tramUrl
public
string
$tramUrl
$twigCachePath
public
string
$twigCachePath
$twigDebug
public
bool
$twigDebug
$userDateFormat
public
string
$userDateFormat
$userTableName
public
string
$userTableName
$weatherCacheTtlSeconds
public
int
$weatherCacheTtlSeconds
$weatherDateFormat
public
string
$weatherDateFormat
$weatherTableName
public
string
$weatherTableName
$wordApiUrl
public
string
$wordApiUrl
$wordDateFormat
public
string
$wordDateFormat
$wordTableName
public
string
$wordTableName
$dbHost
private
string
$dbHost
$dbName
private
string
$dbName
$dbPassword
private
string
$dbPassword
$dbPort
private
string
$dbPort
$dbUsername
private
string
$dbUsername
Methods
dbDsn()
public
dbDsn() : string
Return values
stringdbPassword()
public
dbPassword() : string
Return values
stringdbUsername()
public
dbUsername() : string
Return values
stringfromEnv()
public
static fromEnv() : self
Tags
Return values
self__construct()
private
__construct(string $loggingDirectoryPath, string $loggingChannelName, string $loggingLevel, string $twigCachePath, bool $twigDebug, string $imgwWeatherUrl, string $airlyEndpoint, string $airlyApiKey, string $airlyLocationId, string $weatherTableName, string $weatherDateFormat, int $weatherCacheTtlSeconds, string $dbHost, string $dbPort, string $dbName, string $dbUsername, string $dbPassword, string $announcementTableName, string $announcementDateFormat, string $announcementMaxValidDate, string $announcementDefaultValidDate, int $announcementMaxTitleLength, int $announcementMinTitleLength, int $announcementMaxTextLength, int $announcementMinTextLength, string $countdownTableName, string $countdownDateFormat, int $countdownMaxTitleLength, string $moduleTableName, string $moduleDateFormat, string $userTableName, string $userDateFormat, int $maxUsernameLength, int $minPasswordLength, string $tramUrl, array<string|int, mixed> $stopID, string $googleCalendarApiKey, string $googleCalendarId, string $quoteApiUrl, string $quoteDateFormat, string $quoteTableName, string $wordApiUrl, string $wordTableName, string $wordDateFormat) : mixed
Parameters
- $loggingDirectoryPath : string
- $loggingChannelName : string
- $loggingLevel : string
- $twigCachePath : string
- $twigDebug : bool
- $imgwWeatherUrl : string
- $airlyEndpoint : string
- $airlyApiKey : string
- $airlyLocationId : string
- $weatherTableName : string
- $weatherDateFormat : string
- $weatherCacheTtlSeconds : int
- $dbHost : string
- $dbPort : string
- $dbName : string
- $dbUsername : string
- $dbPassword : string
- $announcementTableName : string
- $announcementDateFormat : string
- $announcementMaxValidDate : string
- $announcementDefaultValidDate : string
- $announcementMaxTitleLength : int
- $announcementMinTitleLength : int
- $announcementMaxTextLength : int
- $announcementMinTextLength : int
- $countdownTableName : string
- $countdownDateFormat : string
- $countdownMaxTitleLength : int
- $moduleTableName : string
- $moduleDateFormat : string
- $userTableName : string
- $userDateFormat : string
- $maxUsernameLength : int
- $minPasswordLength : int
- $tramUrl : string
- $stopID : array<string|int, mixed>
- $googleCalendarApiKey : string
- $googleCalendarId : string
- $quoteApiUrl : string
- $quoteDateFormat : string
- $quoteTableName : string
- $wordApiUrl : string
- $wordTableName : string
- $wordDateFormat : string
boolEnv()
Fetches boolean variable type from .env
private
static boolEnv(string $key, bool $default) : bool
Parameters
- $key : string
- $default : bool
Return values
boolfetchEnv()
Fetches variable from .env file
private
static fetchEnv(string $key) : string|null
Parameters
- $key : string
Return values
string|nullintEnv()
Fetches integer variable type from .env
private
static intEnv(string $key, int $default) : int
Parameters
- $key : string
- $default : int
Return values
intoptionalEnv()
Returns default value if variable is not found in .env
private
static optionalEnv(string $key, string $default) : string
Parameters
- $key : string
- $default : string
Return values
stringrequiredEnv()
Fetches required variable from .env and throws error if not found
private
static requiredEnv(string $key) : string
Parameters
- $key : string