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>';
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:
interfaceHasName{/** @return string */publicfunctiongetName();}className{public$name;}classUserimplementsHasName{/** @return string|Name */publicfunctiongetName(){returnnewName('foo');// This is a violation of the ``HasName`` interface// which only allows a string value to be returned.}}
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: