Merge pull request #313 from shama/patch-timehelper

Add missing @link to TimeHelper docblocks and correct @return
This commit is contained in:
José Lorenzo Rodríguez 2011-11-11 11:15:42 -08:00
commit a5d497068b

View file

@ -61,6 +61,7 @@ class TimeHelper extends AppHelper {
* Accepts the special specifier %S which mimics th modifier S for date()
* @param string $time UNIX timestamp
* @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) {
if (!$time) {
@ -172,7 +173,8 @@ class TimeHelper extends AppHelper {
*
* @param string $serverTime UNIX timestamp
* @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) {
$serverOffset = $this->serverOffset();
@ -185,6 +187,7 @@ class TimeHelper extends AppHelper {
* Returns server's offset from GMT in seconds.
*
* @return integer Offset
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function serverOffset() {
return date('Z', time());
@ -311,6 +314,7 @@ class TimeHelper extends AppHelper {
* @param string $dateString Datetime string or Unix timestamp
* @param integer $userOffset User's offset from GMT (in hours)
* @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) {
$date = $this->fromString($dateString, $userOffset);
@ -708,6 +712,7 @@ class TimeHelper extends AppHelper {
* @param boolean $invalid flag to ignore results of fromString == false
* @param integer $userOffset User's offset from GMT (in hours)
* @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) {
$time = $this->fromString($date, $userOffset);
@ -732,6 +737,7 @@ class TimeHelper extends AppHelper {
* @param boolean $invalid flag to ignore results of fromString == false
* @param integer $userOffset User's offset from GMT (in hours)
* @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) {
$date = $this->fromString($date, $userOffset);