Passed
Push — fix/radiobuttonstyling ( e57dd3...53f350 )
by Ben
15:46 queued 08:51
created

HomepageSetCheck::notifiers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
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 32
{
12
    public function check(): bool
13 32
    {
14
        $homepageValue = chiefSetting(Setting::HOMEPAGE);
15 32
16
        return !!$homepageValue;
17
    }
18 32
19
    public function message(): string
20 32
    {
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 [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array(Thinktomorr...lertBarNotifier::class) returns the type array<integer,string> which is incompatible with the return type mandated by Thinktomorrow\Chief\Heal...ealthCheck::notifiers() of Thinktomorrow\Chief\Heal...or\Notifiers\Notifier[].

In the issue above, the returned value is violating the contract defined by the mentioned interface.

Let's take a look at an example:

interface HasName {
    /** @return string */
    public function getName();
}

class Name {
    public $name;
}

class User implements HasName {
    /** @return string|Name */
    public function getName() {
        return new Name('foo'); // This is a violation of the ``HasName`` interface
                                // which only allows a string value to be returned.
    }
}
Loading history...
27
            AlertBarNotifier::class,
28
        ];
29
    }
30
}
31