Response.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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(): int
  25. {
  26. return $this->statusCode;
  27. }
  28. /**
  29. * @return static
  30. */
  31. public function withStatus($code, $reasonPhrase = '')
  32. {
  33. throw new \BadMethodCallException('Not implemented.');
  34. }
  35. public function getReasonPhrase(): string
  36. {
  37. throw new \BadMethodCallException('Not implemented.');
  38. }
  39. }