Configuration
in package
uses
LogsMessagesTrait
Configuration can come from one or more of the following sources (from highest to lowest priority): - values defined in php.ini - environment variable ($_SERVER) - configuration file (todo)
Table of Contents
Methods
- getBoolean() : bool
- getDefault() : mixed
- getEnum() : string
- getFloat() : float
- getInt() : int
- getKnownValues() : array<string|int, mixed>|null
- getList() : array<string|int, mixed>
- getMap() : array<string|int, mixed>
- getMixed() : mixed
- getRatio() : float
- getString() : string
- getType() : string|null
- has() : bool
- isEmpty() : bool
- logDebug() : void
- logError() : void
- logInfo() : void
- logNotice() : void
- logWarning() : void
- doLog() : void
- shouldLog() : bool
- validateVariableType() : string
- validateVariableValue() : mixed
Methods
getBoolean()
public
static getBoolean(string $key[, bool|null $default = null ]) : bool
Parameters
- $key : string
- $default : bool|null = null
Return values
boolgetDefault()
public
static getDefault(string $variableName) : mixed
Parameters
- $variableName : string
getEnum()
public
static getEnum(string $key[, string|null $default = null ]) : string
Parameters
- $key : string
- $default : string|null = null
Return values
stringgetFloat()
public
static getFloat(string $key[, float|null $default = null ]) : float
Parameters
- $key : string
- $default : float|null = null
Return values
floatgetInt()
public
static getInt(string $key[, int|null $default = null ]) : int
Parameters
- $key : string
- $default : int|null = null
Return values
intgetKnownValues()
public
static getKnownValues(string $variableName) : array<string|int, mixed>|null
Parameters
- $variableName : string
Return values
array<string|int, mixed>|nullgetList()
public
static getList(string $key[, array<string|int, mixed>|null $default = null ]) : array<string|int, mixed>
Parameters
- $key : string
- $default : array<string|int, mixed>|null = null
Return values
array<string|int, mixed>getMap()
public
static getMap(string $key[, array<string|int, mixed>|null $default = null ]) : array<string|int, mixed>
Parameters
- $key : string
- $default : array<string|int, mixed>|null = null
Return values
array<string|int, mixed>getMixed()
public
static getMixed(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
getRatio()
public
static getRatio(string $key[, float|null $default = null ]) : float
Parameters
- $key : string
- $default : float|null = null
Return values
floatgetString()
public
static getString(string $key[, string|null $default = null ]) : string
Parameters
- $key : string
- $default : string|null = null
Return values
stringgetType()
public
static getType(string $variableName) : string|null
Parameters
- $variableName : string
Return values
string|nullhas()
public
static has(string $name) : bool
Parameters
- $name : string
Return values
boolisEmpty()
public
static isEmpty(mixed $value) : bool
Parameters
- $value : mixed
Return values
boollogDebug()
protected
static logDebug(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logError()
protected
static logError(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logInfo()
protected
static logInfo(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logNotice()
protected
static logNotice(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logWarning()
protected
static logWarning(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
doLog()
private
static doLog(string $level, string $message, array<string|int, mixed> $context) : void
Parameters
- $level : string
- $message : string
- $context : array<string|int, mixed>
shouldLog()
private
static shouldLog(string $level) : bool
Parameters
- $level : string
Return values
boolvalidateVariableType()
private
static validateVariableType(string $variableName, string $type) : string
Parameters
- $variableName : string
- $type : string
Return values
stringvalidateVariableValue()
private
static validateVariableValue(mixed $value[, int|null $filterType = null ]) : mixed
Parameters
- $value : mixed
- $filterType : int|null = null