![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/laminas/laminas-diactoros/src/Response/ |
<?php declare(strict_types=1); namespace Laminas\Diactoros\Response; use Laminas\Diactoros\Exception; use Laminas\Diactoros\Response; use Psr\Http\Message\UriInterface; use function gettype; use function is_object; use function is_string; use function sprintf; /** * Produce a redirect response. */ class RedirectResponse extends Response { /** * Create a redirect response. * * Produces a redirect response with a Location header and the given status * (302 by default). * * Note: this method overwrites the `location` $headers value. * * @param string|UriInterface $uri URI for the Location header. * @param int $status Integer status code for the redirect; 302 by default. * @param array $headers Array of headers to use at initialization. */ public function __construct($uri, int $status = 302, array $headers = []) { if (! is_string($uri) && ! $uri instanceof UriInterface) { throw new Exception\InvalidArgumentException(sprintf( 'Uri provided to %s MUST be a string or Psr\Http\Message\UriInterface instance; received "%s"', self::class, is_object($uri) ? $uri::class : gettype($uri) )); } $headers['location'] = [(string) $uri]; parent::__construct('php://temp', $status, $headers); } }