Open boesing opened 8 months ago
This implies service manager annotations are wrong somehow. Actually it looks like what we seen with template constraints in inputfilter today.
Service manager does not provide generics on class Level. So these cant be wrong. only plugin managers have class-level generics as these are limited to specific class implementations via instanceOf property.
This has been further improved in v4 of servicemanager via "SingleInstancePluginManager" abstraction.
might just be Inputfilter having invalid generics as well.
Bug Report
Summary
The
RoutePluginManager
is a plugin manager implementations. Plugin manager implementations have to provide their generic type instead of passing it to someone else.Current behavior
https://github.com/laminas/laminas-router/blob/fceae295d4333bc395c496ee614b7a14e24828be/src/RoutePluginManager.php#L30-L31
How to reproduce
Just consume the route plugin manager via service manager and then use either
get
orbuild
method. Psalm is only able to infermixed|object
instead ofRouteInterface
(which is the instance the plugin manager provides).https://github.com/laminas/laminas-router/blob/fceae295d4333bc395c496ee614b7a14e24828be/src/RoutePluginManager.php#L41
Expected behavior