@@ -31,12 +31,12 @@ |
||
31 | 31 | |
32 | 32 | class TimeFormat |
33 | 33 | { |
34 | - /** |
|
35 | - * TimeFormat |
|
36 | - * |
|
37 | - * @param string $date |
|
38 | - * @return string |
|
39 | - */ |
|
34 | + /** |
|
35 | + * TimeFormat |
|
36 | + * |
|
37 | + * @param string $date |
|
38 | + * @return string |
|
39 | + */ |
|
40 | 40 | public static function timeAgo($date) { |
41 | 41 | |
42 | 42 | $time_og = strtotime($date); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | 'decade', |
52 | 52 | ]; |
53 | 53 | |
54 | - $intervals = [ |
|
54 | + $intervals = [ |
|
55 | 55 | '60', |
56 | 56 | '60', |
57 | 57 | '24', |
@@ -65,17 +65,17 @@ discard block |
||
65 | 65 | |
66 | 66 | $difference = $now - $time_og; |
67 | 67 | |
68 | - for($j = 0; $difference >= $intervals[$j] && $j < count($intervals)-1; $j++) { |
|
69 | - $difference /= $intervals[$j]; |
|
68 | + for ($j = 0; $difference >= $intervals[ $j ] && $j < count($intervals) - 1; $j++) { |
|
69 | + $difference /= $intervals[ $j ]; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | $difference = round($difference); |
73 | 73 | |
74 | - if($difference != 1) { |
|
75 | - $units[$j].= 's'; |
|
74 | + if ($difference != 1) { |
|
75 | + $units[ $j ] .= 's'; |
|
76 | 76 | } |
77 | 77 | |
78 | - $ago = $difference .''. $units[$j] .'ago'; |
|
78 | + $ago = $difference . '' . $units[ $j ] . 'ago'; |
|
79 | 79 | |
80 | 80 | return $ago; |
81 | 81 | } |