-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add StreamWrapperInterface #10506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Methods in StreamWrapper are not required until called function is using them, and interfaces would make them required. |
This is a known issue with user streams (and streams in general). Moreover, it would need to be split into a lot of smaller interfaces as not all streams need to seekable, castable, writeable, etc. |
There has not been any recent activity in this feature request. It will automatically be closed in 14 days if no further action is taken. Please see https://github.com/probot/stale#is-closing-stale-issues-really-a-good-idea to understand why we auto-close stale feature requests. |
Up |
There has not been any recent activity in this feature request. It will automatically be closed in 14 days if no further action is taken. Please see https://github.com/probot/stale#is-closing-stale-issues-really-a-good-idea to understand why we auto-close stale feature requests. |
up |
@xepozz Unless you're working on RFC there is no point in keeping this issue open. |
Could you help me with RFC? |
I've never created RFC so I'm not the best person to ask. You can find more info here: https://wiki.php.net/rfc/howto As per that page, you should start by presenting your proposal on internals mailing list. Good luck! |
There has not been any recent activity in this feature request. It will automatically be closed in 14 days if no further action is taken. Please see https://github.com/probot/stale#is-closing-stale-issues-really-a-good-idea to understand why we auto-close stale feature requests. |
I think this is a valid request but it would so much easier if the default interface methods were introduced as almost all methods are optional. @morrisonlevi do you have any plans to propose this again? |
There has not been any recent activity in this feature request. It will automatically be closed in 14 days if no further action is taken. Please see https://github.com/probot/stale#is-closing-stale-issues-really-a-good-idea to understand why we auto-close stale feature requests. |
Still want :) |
There has not been any recent activity in this feature request. It will automatically be closed in 14 days if no further action is taken. Please see https://github.com/probot/stale#is-closing-stale-issues-really-a-good-idea to understand why we auto-close stale feature requests. |
I'm re-opening this as there is currently an RFC for optional interface in voting which is basically the main thing that is needed for this: https://wiki.php.net/rfc/optional-interfaces |
I got a bit confused by this RFC. What this needs are default interface methods so just optionally providing all methods. Optional interface is about something else. I will keep this open for a little bit hoping that someone will propose it - not sure if I find time to do it myself but if someone is looking for some feature, this would be really cool from the stream PoV. |
@bukka Can you clarify how the RFC helps with this issue? It implements optional interfaces (i.e. the interface is allowed to not exist), rather than optional interface methods (you may choose not to implement all methods of an interface). Edit: Ah, you just sent a follow-up 🙂 |
Yeah I just saw optional and interface together and got too excited 😄 |
I mentioned in the thread it confused me at first as well, as I was already familiar with optional interface methods from |
Description
I had to deal with https://www.php.net/manual/en/class.streamwrapper.php and faced with a problem that it's not a real class/interface reportedly documentation quote
This is NOT a real class, only a prototype of how a class defining its own protocol should be.
.But if you try to implement your own wrapper you may face with lots of errors like
the method % does not exist
. That's sad and I understand the base, but what do you think about adding just a common interface like I have made in the core? I'm sure that not only me did the same in their projects and this structured interface may have people to implement their own wrappers.I didn't deep into all possible usage combinations of the wrappers, but it would be great to separate the one onto a few interfaces by ISP principle.
I may create the PR, but show me all places I need to change.
The text was updated successfully, but these errors were encountered: