Nyholm / psr7

A super lightweight PSR-7 implementation
MIT License
1.16k stars 75 forks source link

Improve extensibility by removing `@final` and making Stream's constructor public #203

Closed nicolas-grekas closed 1 year ago

nicolas-grekas commented 1 year ago

I'm working on a situation where I'd like to have control over the signature of the constructor of PSR-7 implementations. I managed to use inheritance for all implementations but nyholm/psr7 That's why I'm proposing this change. It improves extensibility without hurting maintainability IMHO.

nicolas-grekas commented 1 year ago

IMHO, the @final annotations are the one remaining thing that might prevent wider adoption of this lib. The reason is that there are legitimate use cases for extending the classes (eg mine ;))

I think we need to figure out why we're using these annotations. If the reason is because they make maintenance easier, then that's legit. But if the reason is to "annoy" people because we think they should not extend the classes, then I want us to reconsider this reasoning, because then the reason becomes arbitrary, as in "us, the authors, think we know better than you, and we restrict you from doing that, because we decided so."

So, does @final help maintenance in any way? I don't think so.