Open Journal Systems  3.3.0
Guzzle\Service\Description\SchemaFormatter Class Reference

Static Public Member Functions

static format ($format, $value)
 
static formatBooleanAsString ($value)
 
static formatDate ($value)
 
static formatDateTime ($value)
 
static formatDateTimeHttp ($value)
 
static formatTime ($value)
 
static formatTimestamp ($value)
 

Static Protected Member Functions

static dateFormatter ($dateTime, $format)
 
static getUtcTimeZone ()
 

Static Protected Attributes

static $utcTimeZone
 

Detailed Description

JSON Schema formatter class

Definition at line 10 of file SchemaFormatter.php.

Member Function Documentation

◆ dateFormatter()

static Guzzle\Service\Description\SchemaFormatter::dateFormatter (   $dateTime,
  $format 
)
staticprotected

Perform the actual DateTime formatting

Parameters
int | string | \DateTime$dateTimeDate time value
string$formatFormat of the result
Returns
string
Exceptions
InvalidArgumentException

Definition at line 140 of file SchemaFormatter.php.

Referenced by Guzzle\Service\Description\SchemaFormatter\formatDate(), Guzzle\Service\Description\SchemaFormatter\formatDateTime(), Guzzle\Service\Description\SchemaFormatter\formatDateTimeHttp(), Guzzle\Service\Description\SchemaFormatter\formatTime(), and Guzzle\Service\Description\SchemaFormatter\formatTimestamp().

◆ format()

◆ formatBooleanAsString()

static Guzzle\Service\Description\SchemaFormatter::formatBooleanAsString (   $value)
static

Formats a boolean value as a string

Parameters
string | integer | bool$valueValue to convert to a boolean 'true' / 'false' value
Returns
string

Definition at line 98 of file SchemaFormatter.php.

Referenced by Guzzle\Service\Description\SchemaFormatter\format().

◆ formatDate()

static Guzzle\Service\Description\SchemaFormatter::formatDate (   $value)
static

Create a YYYY-MM-DD formatted string

Parameters
string | integer | \DateTime$valueDate time value
Returns
string

Definition at line 74 of file SchemaFormatter.php.

References Guzzle\Service\Description\SchemaFormatter\dateFormatter().

Referenced by Guzzle\Service\Description\SchemaFormatter\format().

◆ formatDateTime()

static Guzzle\Service\Description\SchemaFormatter::formatDateTime (   $value)
static

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

Parameters
string | integer | \DateTime$valueDate time value
Returns
string

Definition at line 50 of file SchemaFormatter.php.

References Guzzle\Service\Description\SchemaFormatter\dateFormatter().

Referenced by Guzzle\Service\Description\SchemaFormatter\format().

◆ formatDateTimeHttp()

static Guzzle\Service\Description\SchemaFormatter::formatDateTimeHttp (   $value)
static

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

Parameters
string | integer | \DateTime$valueDate time value
Returns
string

Definition at line 62 of file SchemaFormatter.php.

References Guzzle\Service\Description\SchemaFormatter\dateFormatter().

Referenced by Guzzle\Service\Description\SchemaFormatter\format().

◆ formatTime()

static Guzzle\Service\Description\SchemaFormatter::formatTime (   $value)
static

Create a hh:mm:ss formatted string

Parameters
string | integer | \DateTime$valueDate time value
Returns
string

Definition at line 86 of file SchemaFormatter.php.

References Guzzle\Service\Description\SchemaFormatter\dateFormatter().

Referenced by Guzzle\Service\Description\SchemaFormatter\format().

◆ formatTimestamp()

static Guzzle\Service\Description\SchemaFormatter::formatTimestamp (   $value)
static

Return a UNIX timestamp in the UTC timezone

Parameters
string | integer | \DateTime$valueTime value
Returns
int

Definition at line 110 of file SchemaFormatter.php.

References Guzzle\Service\Description\SchemaFormatter\dateFormatter().

Referenced by Guzzle\Service\Description\SchemaFormatter\format().

◆ getUtcTimeZone()

static Guzzle\Service\Description\SchemaFormatter::getUtcTimeZone ( )
staticprotected

Get a UTC DateTimeZone object

Returns
\DateTimeZone

Definition at line 120 of file SchemaFormatter.php.

References Guzzle\Service\Description\SchemaFormatter\$utcTimeZone.

Field Documentation

◆ $utcTimeZone

Guzzle\Service\Description\SchemaFormatter::$utcTimeZone
staticprotected

The documentation for this class was generated from the following file: