Response.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Bridge\PsrHttpMessage\Tests\Fixtures;
  11. use Psr\Http\Message\ResponseInterface;
  12. use Psr\Http\Message\StreamInterface;
  13. /**
  14. * @author Kévin Dunglas <dunglas@gmail.com>
  15. */
  16. class Response extends Message implements ResponseInterface
  17. {
  18. private $statusCode;
  19. public function __construct($version = '1.1', array $headers = [], StreamInterface $body = null, $statusCode = 200)
  20. {
  21. parent::__construct($version, $headers, $body);
  22. $this->statusCode = $statusCode;
  23. }
  24. public function getStatusCode()
  25. {
  26. return $this->statusCode;
  27. }
  28. public function withStatus($code, $reasonPhrase = '')
  29. {
  30. throw new \BadMethodCallException('Not implemented.');
  31. }
  32. public function getReasonPhrase()
  33. {
  34. throw new \BadMethodCallException('Not implemented.');
  35. }
  36. }