\GuzzleHttp\Command\GuzzleSchemaFormatter

JSON Schema formatter class

Summary

Methods
Properties
Constants
format()
No public properties found
No constants found
dateFormatter()
No protected properties found
N/A
formatDateTime()
formatDateTimeHttp()
formatDate()
formatTime()
formatBooleanAsString()
formatTimestamp()
No private properties found
N/A

Methods

format()

format(string  $format, mixed  $value) : mixed

Format a value by a registered format name

Parameters

string $format

Registered format used to format the value

mixed $value

Value being formatted

Returns

mixed —

dateFormatter()

dateFormatter(int|string|\DateTime  $dateTime, string  $format) : string

Perform the actual DateTime formatting

Parameters

int|string|\DateTime $dateTime

Date time value

string $format

Format of the result

Throws

\InvalidArgumentException

Returns

string —

formatDateTime()

formatDateTime(string|int|\DateTime  $value) : string

Create a ISO 8601 (YYYY-MM-DDThh:mm:ssZ) formatted date time value in UTC time.

Parameters

string|int|\DateTime $value

Date time value

Returns

string —

formatDateTimeHttp()

formatDateTimeHttp(string|int|\DateTime  $value) : string

Create an HTTP date (RFC 1123 / RFC 822) formatted UTC date-time string

Parameters

string|int|\DateTime $value

Date time value

Returns

string —

formatDate()

formatDate(string|int|\DateTime  $value) : string

Create a YYYY-MM-DD formatted string

Parameters

string|int|\DateTime $value

Date time value

Returns

string —

formatTime()

formatTime(string|int|\DateTime  $value) : string

Create a hh:mm:ss formatted string

Parameters

string|int|\DateTime $value

Date time value

Returns

string —

formatBooleanAsString()

formatBooleanAsString(string|int|bool  $value) : string

Formats a boolean value as a string

Parameters

string|int|bool $value

Value to convert to a boolean 'true' / 'false' value

Returns

string —

formatTimestamp()

formatTimestamp(string|int|\DateTime  $value) : int

Return a UNIX timestamp in the UTC timezone

Parameters

string|int|\DateTime $value

Time value

Returns

int —