Passed
Push — main ( 62790e...23fbb2 )
by Paul
13:43 queued 05:55
created

LicenseNotice::version()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Notices;
4
5
use GeminiLabs\SiteReviews\License;
6
7
class LicenseNotice extends AbstractNotice
8
{
9
    public function render(): void
10
    {
11
        $licensing = glsr(License::class)->status();
12
        if ($licensing['isSaved'] && $licensing['isValid']) {
13
            return;
14
        }
15
        if ($this->isDismissed() && $licensing['isValid']) {
16
            return;
17
        }
18
        glsr()->render('partials/notices/license', $licensing);
19
    }
20
21
    protected function canRender(): bool
22
    {
23
        if (!$this->hasPermission()) {
24
            return false;
25
        }
26
        if (!$this->isNoticeScreen()) {
27
            return false;
28
        }
29
        return true;
30
    }
31
32
    protected function isMonitored(): bool
33
    {
34
        return false;
35
    }
36
37
    protected function version(): string
38
    {
39
        return glsr()->version('minor');
40
    }
41
}
42