SchemaFormatter
in package
JSON Schema formatter class
Table of Contents
Properties
- $utcTimeZone : DateTimeZone
Methods
- format() : mixed
- Format a value by a registered format name
- formatBooleanAsString() : string
- Formats a boolean value as a string
- formatDate() : string
- Create a YYYY-MM-DD formatted string
- formatDateTime() : string
- Create a ISO 8601 (YYYY-MM-DDThh:mm:ssZ) formatted date time value in UTC time
- formatDateTimeHttp() : string
- Create an HTTP date (RFC 1123 / RFC 822) formatted UTC date-time string
- formatTime() : string
- Create a hh:mm:ss formatted string
- formatTimestamp() : int
- Return a UNIX timestamp in the UTC timezone
- dateFormatter() : string
- Perform the actual DateTime formatting
- getUtcTimeZone() : DateTimeZone
- Get a UTC DateTimeZone object
Properties
$utcTimeZone
protected
static DateTimeZone
$utcTimeZone
Methods
format()
Format a value by a registered format name
public
static format(string $format, mixed $value) : mixed
Parameters
- $format : string
-
Registered format used to format the value
- $value : mixed
-
Value being formatted
formatBooleanAsString()
Formats a boolean value as a string
public
static formatBooleanAsString(string|int|bool $value) : string
Parameters
- $value : string|int|bool
-
Value to convert to a boolean 'true' / 'false' value
Return values
stringformatDate()
Create a YYYY-MM-DD formatted string
public
static formatDate(string|int|DateTime $value) : string
Parameters
- $value : string|int|DateTime
-
Date time value
Return values
stringformatDateTime()
Create a ISO 8601 (YYYY-MM-DDThh:mm:ssZ) formatted date time value in UTC time
public
static formatDateTime(string|int|DateTime $value) : string
Parameters
- $value : string|int|DateTime
-
Date time value
Return values
stringformatDateTimeHttp()
Create an HTTP date (RFC 1123 / RFC 822) formatted UTC date-time string
public
static formatDateTimeHttp(string|int|DateTime $value) : string
Parameters
- $value : string|int|DateTime
-
Date time value
Return values
stringformatTime()
Create a hh:mm:ss formatted string
public
static formatTime(string|int|DateTime $value) : string
Parameters
- $value : string|int|DateTime
-
Date time value
Return values
stringformatTimestamp()
Return a UNIX timestamp in the UTC timezone
public
static formatTimestamp(string|int|DateTime $value) : int
Parameters
- $value : string|int|DateTime
-
Time value
Return values
intdateFormatter()
Perform the actual DateTime formatting
protected
static dateFormatter(int|string|DateTime $dateTime, string $format) : string
Parameters
- $dateTime : int|string|DateTime
-
Date time value
- $format : string
-
Format of the result
Tags
Return values
stringgetUtcTimeZone()
Get a UTC DateTimeZone object
protected
static getUtcTimeZone() : DateTimeZone