northwoods / container

Container wrapper for Auryn dependency injector
MIT License
9 stars 3 forks source link

Zend Expressive FlashMiddleware or SessionMiddleware are not invoked #16

Closed Musiksammler closed 6 years ago

Musiksammler commented 6 years ago

Hello!

I've added zend-expressive-session, zend-expressive-session-ext and zend-expressive-flash to my zend-expressive project (as documented in https://docs.zendframework.com/zend-expressive/v3/cookbook/flash-messengers/) and I'm using Auryn for dependencies.

With Northwoods Container 2.1.0 everything works fine. But with the current 3.1.0 branch invokables from these packages fail with the error that the classes are expected to be invokable.

As far as I could see it's expected that these classes have a "__invoke()" method, which is not the case. Instead they have simple constructors without any required parameters. So they should be treated like they are invokable but they're not.

shadowhand commented 6 years ago

How are you using them? They shouldn't require any container configuration at all.

Musiksammler commented 6 years ago

Just like in the documentation. I added the packages to my composer.json, confirmed that config.php should be extended and nothing more. The ConfigProvider classes were added to the config.php file and the Middlewares were added to the pipeline.php.

That's all.

shadowhand commented 6 years ago

The configuration is broken. The middleware used to be invokable but no longer are. They should be listed as services not invokables. I recommend opening an issue upstream.

Edit: Or they should have a factory class.