endroid / qr-code

QR Code Generator
https://endroid.nl
MIT License
4.46k stars 728 forks source link

Support PSR-7 directly instead of symfony/http-foundation #239

Closed ricardofiorani closed 4 years ago

ricardofiorani commented 4 years ago

Today the QR-Code lib requires symfony/http-foundation, however, if you don't use Symfony but any other PSR-7, you will have rely on symfony/http-foundation to support the PSR-7.

Ideally, this lib would support PSR-7 to be framework agnostic and interoperable. Then on the Symfony Bundle it would support PSR-7 via the symfony/http-foundation

ricardofiorani commented 4 years ago

To be more precise and directly, I mean this class:

https://github.com/endroid/qr-code/blob/master/src/Response/QrCodeResponse.php

It should implement PSR-7's ResponseInterface (https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) instead of extending Symfony's Symfony\Component\HttpFoundation\Response

endroid commented 4 years ago

Hi @ricardofiorani. The implementation here is indeed too much tied to Symfony so I was already planning to move it. It is now placed in the bundle. No further need to implement any PSR-7 interfaces in the core library as any bundle or integration is free to provide its own response implementation if needed. Thank you.