Skip to content

Commit

Permalink
Fix code standards errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed May 13, 2012
1 parent d924404 commit 64f03ac
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions lib/Cake/Utility/CakeTime.php
Expand Up @@ -376,7 +376,7 @@ public static function niceShort($dateString = null, $timezone = null) {

$y = self::isThisYear($date) ? '' : ' %Y';

$d = self::_strftime("%w", $date);
$d = self::_strftime("%w", $date);
$day = array(
__d('cake', 'Sunday'),
__d('cake', 'Monday'),
Expand Down Expand Up @@ -701,8 +701,6 @@ public static function timeAgoInWords($dateTime, $options = array()) {
$format = $options;
}

extract($accuracy, EXTR_PREFIX_ALL, 'format');

$now = self::fromString(time(), $timezone);
$inSeconds = self::fromString($dateTime, $timezone);
$backwards = ($inSeconds > $now);
Expand Down Expand Up @@ -785,19 +783,19 @@ public static function timeAgoInWords($dateTime, $options = array()) {
$relativeDate = __d('cake', 'on %s', date($format, $inSeconds));
} else {
if ($years > 0) {
$f = $format_year;
$f = $accuracy['year'];
} elseif (abs($months) > 0) {
$f = $format_month;
$f = $accuracy['month'];
} elseif (abs($weeks) > 0) {
$f = $format_week;
$f = $accuracy['week'];
} elseif (abs($days) > 0) {
$f = $format_day;
$f = $accuracy['day'];
} elseif (abs($hours) > 0) {
$f = $format_hour;
$f = $accuracy['hour'];
} elseif (abs($minutes) > 0) {
$f = $format_minute;
$f = $accuracy['minute'];
} else {
$f = $format_second;
$f = $accuracy['second'];
}

$f = str_replace(array('year', 'month', 'week', 'day', 'hour', 'minute', 'second'), array(1, 2, 3, 4, 5, 6, 7), $f);
Expand Down

3 comments on commit 64f03ac

@mfjohansson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a lot of fixes to my patch, sorry for that.

@ADmad
Copy link
Member

@ADmad ADmad commented on 64f03ac May 13, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mfjohansson You can use this in future :)

@mfjohansson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ADmad Thanks :)

Please sign in to comment.