PageEditsInLastYear::nameSpacesRequired()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Sunnysideup\HealthCheckProvider\Checks\Content;
4
5
use SilverStripe\ORM\DB;
6
use Sunnysideup\HealthCheckProvider\Checks\HealthCheckItemRunner;
7
8
class PageEditsInLastYear extends HealthCheckItemRunner
9
{
10
    private static $limit = 3;
0 ignored issues
show
introduced by
The private property $limit is not used, and could be removed.
Loading history...
11
12
    public function getCalculatedAnswer(): array
13
    {
14
        $returnArray = [];
15
        $rows = DB::query('SELECT unix_timestamp(LastEdited) as A FROM SiteTree_Versions');
16
        foreach ($rows as $row) {
17
            $returnArray[] = $row['A'];
18
        }
19
20
        return $returnArray;
21
    }
22
23
    protected function nameSpacesRequired(): array
24
    {
25
        return [
26
            'SilverStripe\\Reports',
27
        ];
28
    }
29
}
30