Completed
Push — master ( 0d75b5...ea1463 )
by angel
01:10
created
src/TimeFormat.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.