QrCodeResponse.php 552 B

1234567891011121314151617181920212223
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * (c) Jeroen van den Enden <info@endroid.nl>
  5. *
  6. * This source file is subject to the MIT license that is bundled
  7. * with this source code in the file LICENSE.
  8. */
  9. namespace Endroid\QrCode\Response;
  10. use Endroid\QrCode\QrCodeInterface;
  11. use Symfony\Component\HttpFoundation\Response;
  12. class QrCodeResponse extends Response
  13. {
  14. public function __construct(QrCodeInterface $qrCode)
  15. {
  16. parent::__construct($qrCode->writeString(), Response::HTTP_OK, ['Content-Type' => $qrCode->getContentType()]);
  17. }
  18. }