What is the need to declare classes final? #495
Unanswered
greendrake
asked this question in
Q&A
Replies: 1 comment
-
@greendrake Thanks for bringing this up 👍 I can understand that this might be a inconvenience, but there are reasons to mark these classes as final, for example to quote @clue's comment from reactphp/socket#71:
Not marking these classes as final would result in constant BC breaks once we change our behavior. Instead of using your custom version of the For reference: reactphp/http#283 and reactphp/socket#71 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I find it pretty inconvenient that classes like
HttpServer
andIo\StreamingServer
arefinal
.Say I want to extend the latter so that it emits an event after finishing outputting response to the client — so that I could bind some custom handler to that event in my app.
What I have to do now is to create a custom version of the
Http
package and rewrite those classes.Shouldn't there be an easier, less code-repeating way?
Beta Was this translation helpful? Give feedback.
All reactions