Skip to content
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

Bug in LazyOpenStream #428

Closed
DavidBruchmann opened this issue Jun 27, 2021 · 5 comments
Closed

Bug in LazyOpenStream #428

DavidBruchmann opened this issue Jun 27, 2021 · 5 comments

Comments

@DavidBruchmann
Copy link

LazyOpenStream defines only 2 methods of Psr\Http\Message\StreamInterface but is declared as final.

final class LazyOpenStream implements StreamInterface

As final class it neither includes all methods of the interface, nor allows to be extended to satisfy the interface,

@GrahamCampbell
Copy link
Member

Thanks for getting in touch. Which methods are missing, please?

@DavidBruchmann
Copy link
Author

Sorry, I must correct myself, all methods are existing, I did miss the trait.

Nevertheless, TYPO3 is extending the class, and the "final" is therefore disturbing.
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Http/SelfEmittableLazyOpenStream.php

It might be possible though that the according implementation in TYPO3 should be changed.

@DavidBruchmann
Copy link
Author

The according issue in TYPO3 can be found here if it's of interest:
https://forge.typo3.org/issues/94422

@GrahamCampbell
Copy link
Member

GrahamCampbell commented Jun 28, 2021

Typo3 should make another class that implements that interface and takes a stream into he constructor, and then proxies calls the calls it wants, and customizes the calls it doesn't wanna proxy. Composition over inheritance. :)

@DavidBruchmann
Copy link
Author

Yes it's done just wrong in TYPO3 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants