KnpLabs / Gaufrette

PHP library that provides a filesystem abstraction layer − will be a feast for your files!
http://knplabs.github.io/Gaufrette
MIT License
2.47k stars 355 forks source link

Resolved creation of dynamic property Gaufrette\StreamWrapper:: is de… #702

Open adagber opened 1 year ago

adagber commented 1 year ago

I'm using the knplabs/knp-gaufrette-bundle:v0.8.0 library

Since I have upgraded php version from 8.1 to 8.2 I am getting a deprecated warning "Deprecated: Creation of dynamic property Gaufrette\StreamWrapper::$context is deprecated in .../vendor/symfony/http-foundation/BinaryFileResponse.php on line 199" when returning the file in a controller:

return new BinaryFileResponse('gaufrette://foo/hello.txt');

I've added the public context property to the GaufretteStreamWrapper object as per the native class specification in php:

https://www.php.net/streamwrapper

With this change the code works perfectly, as it does not access the $context property dynamically.

If you think it is convenient I would like to add this change to the library.

Thanks

KevinArtus commented 1 year ago

Thx for your PR. We're working on it to support php 8 and deprecated php 7. We already fix this problem on this PR.

https://github.com/KnpLabs/Gaufrette/pull/692

nocive commented 1 year ago

bump

grempa commented 8 months ago

bump

ihortymoshenko commented 7 months ago

Any updates?

cameronmurphy commented 5 months ago

bump