php-censor/src/Exception/HttpException.php

41 lines
652 B
PHP
Raw Normal View History

2016-04-12 19:31:39 +02:00
<?php
2018-03-04 11:14:09 +01:00
namespace PHPCensor\Exception;
2016-04-12 19:31:39 +02:00
class HttpException extends \Exception
{
2017-11-05 15:48:36 +01:00
/**
* @var integer
*/
protected $errorCode = 500;
/**
* @var string
*/
2016-04-21 19:05:32 +02:00
protected $statusMessage = 'Internal Server Error';
2016-04-12 19:31:39 +02:00
2017-11-05 15:48:36 +01:00
/**
* @return integer
*/
2016-04-21 19:05:32 +02:00
public function getErrorCode()
{
return $this->errorCode;
}
2016-04-12 19:31:39 +02:00
2017-11-05 15:48:36 +01:00
/**
* @return string
*/
2016-04-21 19:05:32 +02:00
public function getStatusMessage()
{
return $this->statusMessage;
}
2016-04-12 19:31:39 +02:00
2017-11-05 15:48:36 +01:00
/**
* @return string
*/
2016-04-21 19:05:32 +02:00
public function getHttpHeader()
{
return 'HTTP/1.1 ' . $this->errorCode . ' ' . $this->statusMessage;
}
}