662a4b3740
Quote from HTTP (bis) spec (Part 2 - 5.1.1): The Reason Phrase exists for the sole purpose of providing a textual description associated with the numeric status code, out of deference to earlier Internet application protocols that were more frequently used with interactive text clients. A client SHOULD ignore the content of the Reason Phrase.
42 lines
929 B
PHP
42 lines
929 B
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the Symfony package.
|
|
*
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Symfony\Component\HttpKernel\Exception;
|
|
|
|
/**
|
|
* HttpException.
|
|
*
|
|
* @author Kris Wallsmith <kris@symfony.com>
|
|
*/
|
|
class HttpException extends \RuntimeException implements HttpExceptionInterface
|
|
{
|
|
protected $statusCode;
|
|
protected $headers;
|
|
|
|
public function __construct($statusCode, $message = null, \Exception $previous = null, array $headers = array(), $code = 0)
|
|
{
|
|
$this->statusCode = $statusCode;
|
|
$this->headers = $headers;
|
|
|
|
parent::__construct($message, 0, $previous);
|
|
}
|
|
|
|
public function getStatusCode()
|
|
{
|
|
return $this->statusCode;
|
|
}
|
|
|
|
public function getHeaders()
|
|
{
|
|
return $this->headers;
|
|
}
|
|
}
|