The method singleton() does not exist on Nip\Container\Bridges\LaravelContainer.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
15
$this->/** @scrutinizer ignore-call */
16
singleton($alias, $concrete);
This check looks for calls to methods that do not seem to exist on a given type.
It looks for the method on the type itself as well as in inherited classes or
implemented interfaces.
This is most likely a typographical error or the method has been renamed.
The expression ImplicitReturnNode returns the type null which is incompatible with the return type mandated by League\Container\Container::share() of League\Container\Definition\DefinitionInterface.
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...
16
}
17
18
public function add($alias, $concrete = null, $share = false)
This check looks for calls to methods that do not seem to exist on a given type.
It looks for the method on the type itself as well as in inherited classes or
implemented interfaces.
This is most likely a typographical error or the method has been renamed.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.