The expression return new ClassNode($this->injector, $instance) returns the type anonymous//src/di/InjectingProviderProvider.php$0 which is incompatible with the return type mandated by Ray\Di\ProviderInterface::get() of Ray\Di\T.
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...
32
{
33
private InjectorInterface $injector;
34
private Set $set;
35
36
public function __construct(InjectorInterface $injector, Set $set)
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: