Skip to content

Commit

Permalink
Merge pull request cakephp#313 from shama/patch-timehelper
Browse files Browse the repository at this point in the history
Add missing @link to TimeHelper docblocks and correct @return
  • Loading branch information
lorenzo committed Nov 11, 2011
2 parents 7d756fd + 7df3252 commit a5d4970
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Cake/View/Helper/TimeHelper.php
Expand Up @@ -61,6 +61,7 @@ public function __construct(View $View, $settings = array()) {
* Accepts the special specifier %S which mimics th modifier S for date() * Accepts the special specifier %S which mimics th modifier S for date()
* @param string $time UNIX timestamp * @param string $time UNIX timestamp
* @return string windows safe and date() function compatible format for strftime * @return string windows safe and date() function compatible format for strftime
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/ */
public function convertSpecifiers($format, $time = null) { public function convertSpecifiers($format, $time = null) {
if (!$time) { if (!$time) {
Expand Down Expand Up @@ -172,7 +173,8 @@ protected function _translateSpecifier($specifier) {
* *
* @param string $serverTime UNIX timestamp * @param string $serverTime UNIX timestamp
* @param integer $userOffset User's offset from GMT (in hours) * @param integer $userOffset User's offset from GMT (in hours)
* @return string UNIX timestamp * @return integer UNIX timestamp
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/ */
public function convert($serverTime, $userOffset) { public function convert($serverTime, $userOffset) {
$serverOffset = $this->serverOffset(); $serverOffset = $this->serverOffset();
Expand All @@ -185,6 +187,7 @@ public function convert($serverTime, $userOffset) {
* Returns server's offset from GMT in seconds. * Returns server's offset from GMT in seconds.
* *
* @return integer Offset * @return integer Offset
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/ */
public function serverOffset() { public function serverOffset() {
return date('Z', time()); return date('Z', time());
Expand Down Expand Up @@ -311,6 +314,7 @@ public function dayAsSql($dateString, $fieldName, $userOffset = null) {
* @param string $dateString Datetime string or Unix timestamp * @param string $dateString Datetime string or Unix timestamp
* @param integer $userOffset User's offset from GMT (in hours) * @param integer $userOffset User's offset from GMT (in hours)
* @return boolean True if datetime string is today * @return boolean True if datetime string is today
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
*/ */
public function isToday($dateString, $userOffset = null) { public function isToday($dateString, $userOffset = null) {
$date = $this->fromString($dateString, $userOffset); $date = $this->fromString($dateString, $userOffset);
Expand Down Expand Up @@ -708,6 +712,7 @@ public function gmt($string = null) {
* @param boolean $invalid flag to ignore results of fromString == false * @param boolean $invalid flag to ignore results of fromString == false
* @param integer $userOffset User's offset from GMT (in hours) * @param integer $userOffset User's offset from GMT (in hours)
* @return string Formatted date string * @return string Formatted date string
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/ */
public function format($format, $date = null, $invalid = false, $userOffset = null) { public function format($format, $date = null, $invalid = false, $userOffset = null) {
$time = $this->fromString($date, $userOffset); $time = $this->fromString($date, $userOffset);
Expand All @@ -732,6 +737,7 @@ public function format($format, $date = null, $invalid = false, $userOffset = nu
* @param boolean $invalid flag to ignore results of fromString == false * @param boolean $invalid flag to ignore results of fromString == false
* @param integer $userOffset User's offset from GMT (in hours) * @param integer $userOffset User's offset from GMT (in hours)
* @return string Formatted and translated date string * @return string Formatted and translated date string
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/ */
public function i18nFormat($date, $format = null, $invalid = false, $userOffset = null) { public function i18nFormat($date, $format = null, $invalid = false, $userOffset = null) {
$date = $this->fromString($date, $userOffset); $date = $this->fromString($date, $userOffset);
Expand Down

0 comments on commit a5d4970

Please sign in to comment.