NoopHydrator.php 685 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * Copyright (C) 2013 Mailgun
  5. *
  6. * This software may be modified and distributed under the terms
  7. * of the MIT license. See the LICENSE file for details.
  8. */
  9. namespace Mailgun\Hydrator;
  10. use Psr\Http\Message\ResponseInterface;
  11. /**
  12. * Do not serialize at all. Just return a PSR-7 response.
  13. *
  14. * @author Tobias Nyholm <tobias.nyholm@gmail.com>
  15. */
  16. final class NoopHydrator implements Hydrator
  17. {
  18. /**
  19. * @param class-string $class
  20. *
  21. * @throws \LogicException
  22. */
  23. public function hydrate(ResponseInterface $response, string $class)
  24. {
  25. throw new \LogicException('The NoopHydrator should never be called');
  26. }
  27. }