Passed
Push — ft/config-healthmonitor ( f13174 )
by Philippe
14:52 queued 03:34
created

HomepageSetCheck   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 6
c 0
b 0
f 0
dl 0
loc 18
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A check() 0 5 1
A message() 0 3 1
A notifiers() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Thinktomorrow\Chief\HealthMonitor\Checks;
6
7
use Thinktomorrow\Chief\Settings\Setting;
8
use Thinktomorrow\Chief\HealthMonitor\Notifiers\AlertBarNotifier;
9
10
class HomepageSetCheck implements HealthCheck
11
{
12
    public function check(): bool
13
    {
14
        $homepageValue = chiefSetting(Setting::HOMEPAGE);
15
16
        return !!$homepageValue;
17
    }
18
19
    public function message(): string
20
    {
21
        return 'Het lijkt erop dat er geen homepagina ingesteld is. Stel er een in hier: <a href="'. route('chief.back.settings.edit') .'" class="text-secondary-800 underline hover:text-white">Settings</a>';
22
    }
23
24
    public function notifiers(): array
25
    {
26
        return [
27
            AlertBarNotifier::class,
28
        ];
29
    }
30
}
31