DateTime docblocks

This commit is contained in:
Mike Jolley 2017-07-18 11:46:07 +01:00
parent 90691e881f
commit 96f0a6e375
1 changed files with 9 additions and 6 deletions

View File

@ -5,7 +5,8 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* WC Wrapper for PHP DateTime.
* WC Wrapper for PHP DateTime which adds support for gmt/utc offset when a
* timezone is absent.
*
* @class WC_DateTime
* @since 3.0.0
@ -16,13 +17,15 @@ if ( ! defined( 'ABSPATH' ) ) {
class WC_DateTime extends DateTime {
/**
* UTC Offset if needed.
* UTC Offset, if needed. Only used when a timezone is not set. When
* timezones are used this will equal 0.
*
* @var integer
*/
protected $utc_offset = 0;
/**
* Output an ISO 8601 date string in local timezone.
* Output an ISO 8601 date string in local (WordPress) timezone.
*
* @since 3.0.0
* @return string
@ -32,7 +35,7 @@ class WC_DateTime extends DateTime {
}
/**
* Set UTC offset.
* Set UTC offset - this is a fixed offset instead of a timezone.
*
* @param int $offset
*/
@ -41,7 +44,7 @@ class WC_DateTime extends DateTime {
}
/**
* getOffset.
* Get UTC offset if set, or default to the DateTime object's offset.
*/
public function getOffset() {
if ( $this->utc_offset ) {
@ -64,7 +67,7 @@ class WC_DateTime extends DateTime {
}
/**
* Missing in PHP 5.2.
* Missing in PHP 5.2 so just here so it can be supported consistently.
*
* @since 3.0.0
* @return int