@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace App\Model; |
6 | 6 | |
@@ -958,16 +958,16 @@ discard block |
||
958 | 958 | |
959 | 959 | if ($info['all'] > 1) { |
960 | 960 | // Number of seconds/days between first and last edit. |
961 | - $secs = $info['last']->getTimestamp() - $info['first']->getTimestamp(); |
|
961 | + $secs = $info['last']->getTimestamp()-$info['first']->getTimestamp(); |
|
962 | 962 | $days = $secs / (60 * 60 * 24); |
963 | 963 | |
964 | 964 | // Average time between edits (in days). |
965 | - $this->editors[$editor]['atbe'] = round($days / ($info['all'] - 1), 1); |
|
965 | + $this->editors[$editor]['atbe'] = round($days / ($info['all']-1), 1); |
|
966 | 966 | } |
967 | 967 | } |
968 | 968 | |
969 | 969 | // Loop through again and add percentages. |
970 | - $this->topTenEditorsByEdits = array_map(function ($editor) use ($topTenCount) { |
|
970 | + $this->topTenEditorsByEdits = array_map(function($editor) use ($topTenCount) { |
|
971 | 971 | $editor['percentage'] = 100 * ($editor['value'] / $topTenCount); |
972 | 972 | return $editor; |
973 | 973 | }, $topTenEditorsByEdits); |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | { |
986 | 986 | // First sort editors array by the amount of text they added. |
987 | 987 | $topTenEditorsByAdded = $this->editors; |
988 | - uasort($topTenEditorsByAdded, function ($a, $b) { |
|
988 | + uasort($topTenEditorsByAdded, function($a, $b) { |
|
989 | 989 | if ($a['added'] === $b['added']) { |
990 | 990 | return 0; |
991 | 991 | } |
@@ -996,12 +996,12 @@ discard block |
||
996 | 996 | $topTenEditorsByAdded = array_keys(array_slice($topTenEditorsByAdded, 0, 10, true)); |
997 | 997 | |
998 | 998 | // Get the sum of added text so that we can add in percentages. |
999 | - $topTenTotalAdded = array_sum(array_map(function ($editor) { |
|
999 | + $topTenTotalAdded = array_sum(array_map(function($editor) { |
|
1000 | 1000 | return $this->editors[$editor]['added']; |
1001 | 1001 | }, $topTenEditorsByAdded)); |
1002 | 1002 | |
1003 | 1003 | // Then build a new array of top 10 editors by added text in the data structure needed for the chart. |
1004 | - return array_map(function ($editor) use ($topTenTotalAdded) { |
|
1004 | + return array_map(function($editor) use ($topTenTotalAdded) { |
|
1005 | 1005 | $added = $this->editors[$editor]['added']; |
1006 | 1006 | return [ |
1007 | 1007 | 'label' => $editor, |