oscarotero / psr7-middlewares

[DEPRECATED] Collection of PSR-7 middlewares
MIT License
668 stars 56 forks source link

Allow same middleware named in different namespaces #78

Closed llaville closed 7 years ago

llaville commented 7 years ago

Hello Oscar,

In past few days, I've created a middleware (with a different implementation code, but with same name) called AccessLog.

Actually, when we use

use Psr7Middlewares\Middleware;

Middleware::registerNamespace("My\Namespace");

We cannot used or own Middleware.

I suggest this PR to solve the conflict, and allow to choose what middleware must prioritary called.

What do you think about this idea ?

Laurent

PS: Idea come from Respect/Validation package ( see https://github.com/Respect/Validation/blob/master/docs/README.md#custom-rules )

oscarotero commented 7 years ago

It's good to me. Thanks!

llaville commented 7 years ago

Hello Oscar,

Is it possible to have a new release, that will include, at least this contrib, please.

Thanks in advance Laurent

oscarotero commented 7 years ago

Released v3.21 with this and other contributions.