The expression return self::MADE_CONTENT returns the type string which is incompatible with the return type mandated by Illuminate\Contracts\View\Factory::make() of Illuminate\Contracts\View\View.
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.}}
Loading history...
26
}
27
28
public function share($key, $value = null)
29
{
30
//
31
}
32
33
public function composer($views, $callback)
34
{
35
//
36
}
37
38
public function creator($views, $callback)
39
{
40
//
41
}
42
43
public function addNamespace($namespace, $hints)
44
{
45
//
46
}
47
48
public function replaceNamespace($namespace, $hints)
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: