Currently, InputFilterPluginManager::get(FQCN::class) yields the union of InputFilterInterface|InputInterface.
Ideally, this would be the given FQCN when it implements one of those interfaces.
Also, the @method get docblock is problematic as it trumps any user defined stubs and causes other problems that I can't remember!
Because the plugin manager here is guaranteed to return InputFilterInterface|InputInterface as opposed to T|mixed, this conflicts with AbstractPluginManager::get().
Furthermore, I think psalm might have issues with class-string<PsalmAliasOfUnion>.
This patch provides correct inference for consumers when they provide a FQCN or string alias at the expense of 2 or 3 extra baselined issues that I believe are due to using a union type for InstanceType on the class level template.
Currently,
InputFilterPluginManager::get(FQCN::class)
yields the union ofInputFilterInterface|InputInterface
.Ideally, this would be the given FQCN when it implements one of those interfaces.
Also, the
@method get
docblock is problematic as it trumps any user defined stubs and causes other problems that I can't remember!Because the plugin manager here is guaranteed to return
InputFilterInterface|InputInterface
as opposed toT|mixed
, this conflicts withAbstractPluginManager::get()
.Furthermore, I think psalm might have issues with
class-string<PsalmAliasOfUnion>
.This patch provides correct inference for consumers when they provide a FQCN or string alias at the expense of 2 or 3 extra baselined issues that I believe are due to using a union type for
InstanceType
on the class level template.