Class Guzzle\Service\Description\SchemaFormatter

InheritanceGuzzle\Service\Description\SchemaFormatter

JSON Schema formatter class

Public Methods

Hide inherited methods

MethodDescriptionDefined By
format() Format a value by a registered format name Guzzle\Service\Description\SchemaFormatter
formatBooleanAsString() Formats a boolean value as a string Guzzle\Service\Description\SchemaFormatter
formatDate() Create a YYYY-MM-DD formatted string Guzzle\Service\Description\SchemaFormatter
formatDateTime() Create a ISO 8601 (YYYY-MM-DDThh:mm:ssZ) formatted date time value in UTC time Guzzle\Service\Description\SchemaFormatter
formatDateTimeHttp() Create an HTTP date (RFC 1123 / RFC 822) formatted UTC date-time string Guzzle\Service\Description\SchemaFormatter
formatTime() Create a hh:mm:ss formatted string Guzzle\Service\Description\SchemaFormatter
formatTimestamp() Return a UNIX timestamp in the UTC timezone Guzzle\Service\Description\SchemaFormatter

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
dateFormatter() Perform the actual DateTime formatting Guzzle\Service\Description\SchemaFormatter
getUtcTimeZone() Get a UTC DateTimeZone object Guzzle\Service\Description\SchemaFormatter

Property Details

$utcTimeZone protected static property
protected static DateTimeZone $utcTimeZone null

Method Details

dateFormatter() protected static method

Perform the actual DateTime formatting

protected static string dateFormatter ( $dateTime, $format )
$dateTime int|string|DateTime

Date time value

$format string

Format of the result

throws Guzzle\Common\Exception\InvalidArgumentException
format() public static method

Format a value by a registered format name

public static mixed format ( $format, $value )
$format string

Registered format used to format the value

$value mixed

Value being formatted

formatBooleanAsString() public static method

Formats a boolean value as a string

public static string formatBooleanAsString ( $value )
$value string|integer|bool

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

formatDate() public static method

Create a YYYY-MM-DD formatted string

public static string formatDate ( $value )
$value string|integer|DateTime

Date time value

formatDateTime() public static method

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

public static string formatDateTime ( $value )
$value string|integer|DateTime

Date time value

formatDateTimeHttp() public static method

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

public static string formatDateTimeHttp ( $value )
$value string|integer|DateTime

Date time value

formatTime() public static method

Create a hh:mm:ss formatted string

public static string formatTime ( $value )
$value string|integer|DateTime

Date time value

formatTimestamp() public static method

Return a UNIX timestamp in the UTC timezone

public static int formatTimestamp ( $value )
$value string|integer|DateTime

Time value

getUtcTimeZone() protected static method

Get a UTC DateTimeZone object

protected static DateTimeZone getUtcTimeZone ( )