Skip to content
This repository
Browse code

Fix code standards errors.

  • Loading branch information...
commit 64f03acd4c78f388222620a31bfba303d10f6947 1 parent d924404
Mark Story authored May 12, 2012

Showing 1 changed file with 8 additions and 10 deletions. Show diff stats Hide diff stats

  1. 18  lib/Cake/Utility/CakeTime.php
18  lib/Cake/Utility/CakeTime.php
@@ -376,7 +376,7 @@ public static function niceShort($dateString = null, $timezone = null) {
376 376
 
377 377
 		$y = self::isThisYear($date) ? '' : ' %Y';
378 378
 
379  
-		$d =  self::_strftime("%w", $date);
  379
+		$d = self::_strftime("%w", $date);
380 380
 		$day = array(
381 381
 			__d('cake', 'Sunday'),
382 382
 			__d('cake', 'Monday'),
@@ -701,8 +701,6 @@ public static function timeAgoInWords($dateTime, $options = array()) {
701 701
 			$format = $options;
702 702
 		}
703 703
 
704  
-		extract($accuracy, EXTR_PREFIX_ALL, 'format');
705  
-
706 704
 		$now = self::fromString(time(), $timezone);
707 705
 		$inSeconds = self::fromString($dateTime, $timezone);
708 706
 		$backwards = ($inSeconds > $now);
@@ -785,19 +783,19 @@ public static function timeAgoInWords($dateTime, $options = array()) {
785 783
 			$relativeDate = __d('cake', 'on %s', date($format, $inSeconds));
786 784
 		} else {
787 785
 			if ($years > 0) {
788  
-				$f = $format_year;
  786
+				$f = $accuracy['year'];
789 787
 			} elseif (abs($months) > 0) {
790  
-				$f = $format_month;
  788
+				$f = $accuracy['month'];
791 789
 			} elseif (abs($weeks) > 0) {
792  
-				$f = $format_week;
  790
+				$f = $accuracy['week'];
793 791
 			} elseif (abs($days) > 0) {
794  
-				$f = $format_day;
  792
+				$f = $accuracy['day'];
795 793
 			} elseif (abs($hours) > 0) {
796  
-				$f = $format_hour;
  794
+				$f = $accuracy['hour'];
797 795
 			} elseif (abs($minutes) > 0) {
798  
-				$f = $format_minute;
  796
+				$f = $accuracy['minute'];
799 797
 			} else {
800  
-				$f = $format_second;
  798
+				$f = $accuracy['second'];
801 799
 			}
802 800
 
803 801
 			$f = str_replace(array('year', 'month', 'week', 'day', 'hour', 'minute', 'second'), array(1, 2, 3, 4, 5, 6, 7), $f);

3 notes on commit 64f03ac

Magnus

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

ADmad
Collaborator
ADmad commented on 64f03ac May 13, 2012

@mfjohansson You can use this in future :)

Magnus

@ADmad Thanks :)

Please sign in to comment.
Something went wrong with that request. Please try again.