chadicus / slim-oauth2-middleware

Middleware for Using OAuth2 within a Slim Framework API
MIT License
47 stars 17 forks source link

Allow PSR-11 containers in 3.x #51

Closed soren121 closed 6 years ago

soren121 commented 6 years ago

I'm a fan of the change to attributes in the 4.x branch, but in the meantime, it'd be nice if the 3.x branch supported PSR-11 containers. I updated my project to use PHP-DI 6 and this library broke because of the container type check. Containers that implement container-interop will still work since Interop\Container\ContainerInterface extends from Psr\Container\ContainerInterface now.

chadicus commented 6 years ago

Thanks!

chadicus commented 6 years ago

@soren121 I've had to remove the 3.3.0 tag which includes this change as it has a bug. If the container is a pure PSR-11 container interface the call to set will fail as it does not define the set method.

soren121 commented 6 years ago

container-interop never had a set method. Your library was always implementation-dependent.

PSR-11 and container-interop are identical interfaces, so I think you have to explicitly check for a set method if you want your tests to pass.

chadicus commented 6 years ago

so I think you have to explicitly check for a set method if you want your tests to pass.

This is exactly what I'm going to do.