zendframework / zend-expressive

PSR-15 middleware in minutes!
BSD 3-Clause "New" or "Revised" License
711 stars 197 forks source link

IMPLICIT_HEAD_MIDDLEWARE_STREAM_FACTORY doesn't return the factory as a service #552

Closed tommyseus closed 6 years ago

tommyseus commented 6 years ago

Branch

release-3.0.0

Error

The Router\IMPLICIT_HEAD_MIDDLEWARE_STREAM_FACTORY doesn't return the factory as a service. It returns a \Zend\Diactoros\Stream instance.

Argument 2 passed to Zend\Expressive\Router\Middleware\ImplicitHeadMiddleware::__construct() must be callable, object given, called in /var/www/application/vendor/zendframework/zend-expressive-router/src/Middleware/ImplicitHeadMiddlewareFactory.php on line 55

Fix

Maybe as Invokable or FactoryFactory.

'invokables' => [
    Router\IMPLICIT_HEAD_MIDDLEWARE_STREAM_FACTORY => Container\StreamFactory::class,
]

or

'factories' => [
    Router\IMPLICIT_HEAD_MIDDLEWARE_STREAM_FACTORY => Container\StreamFactoryFactory::class,
]
weierophinney commented 6 years ago

Fixed with #553.