Options
Trait Options.
Embed base methods to change settings of Carbon classes.
Depends on the following methods:
Table of Contents
Properties
- $localFormatFunction : string|callable|null
- Function to call instead of format.
- $localGenericMacros : array<string|int, mixed>|null
- Instance-specific generic macros.
- $localHumanDiffOptions : int|null
- Options for diffForHumans and forHumans methods.
- $localMacros : array<string|int, mixed>|null
- Instance-specific macros.
- $localMonthsOverflow : bool|null
- Indicates if months should be calculated with overflow.
- $localSerializer : string|callable|null
- Format to use on JSON serialization.
- $localStrictModeEnabled : bool|null
- Indicates if the strict mode is in use.
- $localToStringFormat : string|callable|null
- Format to use on string cast.
- $localYearsOverflow : bool|null
- Indicates if years should be calculated with overflow.
Methods
- __debugInfo() : array<string|int, mixed>
- Show truthy properties on var_dump().
- getSettings() : array<string|int, mixed>
- Returns current local settings.
- settings() : $this|static
- Set specific options.
- shiftTimezone() : void
- addExtraDebugInfos() : void
- isLocalStrictModeEnabled() : bool
Properties
$localFormatFunction
Function to call instead of format.
protected
string|callable|null
$localFormatFunction
= null
$localGenericMacros
Instance-specific generic macros.
protected
array<string|int, mixed>|null
$localGenericMacros
= null
$localHumanDiffOptions
Options for diffForHumans and forHumans methods.
protected
int|null
$localHumanDiffOptions
= null
$localMacros
Instance-specific macros.
protected
array<string|int, mixed>|null
$localMacros
= null
$localMonthsOverflow
Indicates if months should be calculated with overflow.
protected
bool|null
$localMonthsOverflow
= null
Specific setting.
$localSerializer
Format to use on JSON serialization.
protected
string|callable|null
$localSerializer
= null
$localStrictModeEnabled
Indicates if the strict mode is in use.
protected
bool|null
$localStrictModeEnabled
= null
Specific setting.
$localToStringFormat
Format to use on string cast.
protected
string|callable|null
$localToStringFormat
= null
$localYearsOverflow
Indicates if years should be calculated with overflow.
protected
bool|null
$localYearsOverflow
= null
Specific setting.
Methods
__debugInfo()
Show truthy properties on var_dump().
public
__debugInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>getSettings()
Returns current local settings.
public
getSettings() : array<string|int, mixed>
Return values
array<string|int, mixed>settings()
Set specific options.
public
settings(array<string|int, mixed> $settings) : $this|static
- strictMode: true|false|null
- monthOverflow: true|false|null
- yearOverflow: true|false|null
- humanDiffOptions: int|null
- toStringFormat: string|Closure|null
- toJsonFormat: string|Closure|null
- locale: string|null
- timezone: \DateTimeZone|string|int|null
- macros: array|null
- genericMacros: array|null
Parameters
- $settings : array<string|int, mixed>
Return values
$this|staticshiftTimezone()
public
static shiftTimezone(mixed $timezone) : void
Set the timezone
Parameters
- $timezone : mixed
addExtraDebugInfos()
protected
addExtraDebugInfos(array<string|int, mixed> &$infos) : void
Parameters
- $infos : array<string|int, mixed>
isLocalStrictModeEnabled()
protected
isLocalStrictModeEnabled() : bool