@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * This file contains only the ArticleInfo class. |
4 | 4 | */ |
5 | 5 | |
6 | -declare(strict_types = 1); |
|
6 | +declare(strict_types=1); |
|
7 | 7 | |
8 | 8 | namespace AppBundle\Model; |
9 | 9 | |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | |
976 | 976 | if ($info['all'] > 1) { |
977 | 977 | // Number of seconds/days between first and last edit. |
978 | - $secs = $info['last']->getTimestamp() - $info['first']->getTimestamp(); |
|
978 | + $secs = $info['last']->getTimestamp()-$info['first']->getTimestamp(); |
|
979 | 979 | $days = $secs / (60 * 60 * 24); |
980 | 980 | |
981 | 981 | // Average time between edits (in days). |
@@ -984,7 +984,7 @@ discard block |
||
984 | 984 | } |
985 | 985 | |
986 | 986 | // Loop through again and add percentages. |
987 | - $this->topTenEditorsByEdits = array_map(function ($editor) use ($topTenCount) { |
|
987 | + $this->topTenEditorsByEdits = array_map(function($editor) use ($topTenCount) { |
|
988 | 988 | $editor['percentage'] = 100 * ($editor['value'] / $topTenCount); |
989 | 989 | return $editor; |
990 | 990 | }, $topTenEditorsByEdits); |
@@ -1002,7 +1002,7 @@ discard block |
||
1002 | 1002 | { |
1003 | 1003 | // First sort editors array by the amount of text they added. |
1004 | 1004 | $topTenEditorsByAdded = $this->editors; |
1005 | - uasort($topTenEditorsByAdded, function ($a, $b) { |
|
1005 | + uasort($topTenEditorsByAdded, function($a, $b) { |
|
1006 | 1006 | if ($a['added'] === $b['added']) { |
1007 | 1007 | return 0; |
1008 | 1008 | } |
@@ -1013,12 +1013,12 @@ discard block |
||
1013 | 1013 | $topTenEditorsByAdded = array_keys(array_slice($topTenEditorsByAdded, 0, 10, true)); |
1014 | 1014 | |
1015 | 1015 | // Get the sum of added text so that we can add in percentages. |
1016 | - $topTenTotalAdded = array_sum(array_map(function ($editor) { |
|
1016 | + $topTenTotalAdded = array_sum(array_map(function($editor) { |
|
1017 | 1017 | return $this->editors[$editor]['added']; |
1018 | 1018 | }, $topTenEditorsByAdded)); |
1019 | 1019 | |
1020 | 1020 | // Then build a new array of top 10 editors by added text in the data structure needed for the chart. |
1021 | - return array_map(function ($editor) use ($topTenTotalAdded) { |
|
1021 | + return array_map(function($editor) use ($topTenTotalAdded) { |
|
1022 | 1022 | $added = $this->editors[$editor]['added']; |
1023 | 1023 | return [ |
1024 | 1024 | 'label' => $editor, |