@param $httpStatusCode

@return string

@throws Exception
178312
public function getHttpStatusMessage($httpStatusCode)
    {
        switch ($httpStatusCode) {
            case self::HTTP_STATUS_OK:
                return 'OK';
            case self::HTTP_STATUS_BAD_REQUEST:
                return 'Bad Request';
            case self::HTTP_STATUS_UNAUTHORIZED:
                return 'Unauthorized';
            case self::HTTP_STATUS_FORBIDDEN:
                return 'Forbidden';
            case self::HTTP_STATUS_NOT_FOUND:
                return 'Not Found';
            case self::HTTP_STATUS_NOT_ACCEPTABLE:
                return 'Not Acceptable';
            case self::HTTP_STATUS_INTERNAL_SERVER_ERROR:
                return 'Internal Server Error';
            case self::HTTP_STATUS_SERVICE_UNAVAILABLE:
                return 'Service Unavailable';
            default:
                throw new Exception('Http status message is not available.');
        }
    }
328308
public function setHttpStatusCode($code)
    {
        $code = intval($code);
        if (!is_int($code)
            || $code < 100
            || $code > 599
        ) {
            trigger_error('Invalid HTTP status code, not taken into account.', E_USER_WARNING);
            return false;
        }
        $this->httpStatusCode = $code;
        return true;
    }
49853
public static function getText($code)
    {
        $code = (int) $code;

        if (!self::exists($code)) {
            throw new \DomainException('Http Code does not exist!');
        }

        return self::$httpCodes[$code];
	}
1128672
protected function verifyErrorFormat($body, $httpStatusCode)
    {
        if (is_array($body) === false)
        {
            $this->throwServerError($body, $httpStatusCode);
        }

        if ((isset($body['error']) === false) or
            (isset($body['error']['code']) === false))
        {
            $this->throwServerError($body, $httpStatusCode);
        }

        $code = $body['error']['code'];

        if (Errors\ErrorCode::exists($code) === false)
        {
            $this->throwServerError($body, $httpStatusCode);
        }
    }
730218
public function withStatus($code = 200)
    {
        if (!array_key_exists($code, self::$responseCodes)) {
            throw new \Exception('That header code '.$code.' is not allowed.');
        }

        $this->code = $code;
        $this->reasonPhrase = self::$responseCodes[$code];

        return $this;
    }
1335684
function status($code) {
		$reason=@constant('self::HTTP_'.$code);
		if (PHP_SAPI!='cli')
			header($_SERVER['SERVER_PROTOCOL'].' '.$code.' '.$reason);
		return $reason;
	}
921877
protected function getDefaultResponseContent(Exception $ex, int $statusCode) : string
    {
        if ($this->inDevelopmentEnvironment) {
            $content = $this->getDevelopmentEnvironmentContent($ex, $statusCode);
        } else {
            $content = $this->getProductionEnvironmentContent($ex, $statusCode);
        }

        return $content;
    }
1243685
protected function status($status, $code)
	{
		$data = $this->getStatusData($status);
		return $this->jsonResponse($data, $code);
	}
928983
protected function jsonErrorResponse($errorMessage, $statusCode = 400, array $httpHeaders = array())
    {
        $statusTexts = \Symfony\Component\HttpFoundation\Response::$statusTexts;

        return $this->jsonResponse(array(
            'error' => (string) $errorMessage,
        ), array(
            'status' => array(
                'code'    => (int) $statusCode,
                'message' => $statusTexts[$statusCode],
            ),
        ), $httpHeaders);
    }
870370
private function parseStatusLine($line) {
		if (empty($line)) {
			throw new \Exception("Empty status line provided.");
		}
		preg_match('/HTTP\/([^[:space:]])+[[:space:]]+([0-9]*)(.*)/i', $line, $result);
		$this->statusCode = (int)$result[2];
	}
303000
private function getPaysafeException($httpCode, $message = null, $code = null)
    {
        if(!$message) {
            $message = "An unknown error has occurred.";
        }
        if(!$code) {
            $code = $httpCode;
        }

        $exceptionType = '\Paysafe\PaysafeException';
        switch($httpCode) {
            case '400':
                $exceptionType = '\Paysafe\InvalidRequestException';
                break;
            case '401':
                $exceptionType = '\Paysafe\InvalidCredentialsException';
                break;
            case '402':
                $exceptionType = '\Paysafe\RequestDeclinedException';
                break;
            case '403':
                $exceptionType = '\Paysafe\PermissionException';
                break;
            case '404':
                $exceptionType = '\Paysafe\EntityNotFoundException';
                break;
            case '409':
                $exceptionType = '\Paysafe\RequestConflictException';
                break;
            case '406':
            case '415':
                $exceptionType = '\Paysafe\APIException';
                break;
            default:
                if($httpCode >= 500) {
                    $exceptionType = '\Paysafe\APIException';
                }
                break;

        }

        return new $exceptionType($message,$code);
    }
376249
static function statusCode(Exception $e)
    {
        return $e instanceof \Symfony\Component\HttpKernel\Exception\HttpException ? $e->getStatusCode() : 500;
    }
1145117
public static function getStatusMessage($code) {
		if (!$code) {
			return '';
		}

		return isset(self::$statusMessages[$code]) ? self::$statusMessages[$code] : '';
	}
968572
public function hasStatusCode($statusCode)
    {
        try {
            $statusCode = $this->filterStatusCode($statusCode);
        } catch (InvalidArgumentException $e) {
            return false;
        }

        return isset($this->httpStatus[$statusCode]);
    }
114984
protected function determineHttpStatusCode($httpStatusCode) {
		// add the new code
		$category = substr($httpStatusCode, 0, 1);
		$this->httpStatusCodes[$category][$httpStatusCode] = true;
		
		$advisedStatusCode = $httpStatusCode;
		
		// when there's multiple, give preference to 5xx errors
		if (isset($this->httpStatusCodes['5']) && isset($this->httpStatusCodes['4'])) {
			// use a generic one
			$advisedStatusCode = 500;
		}
		elseif (isset($this->httpStatusCodes['5'])) {
			if (count($this->httpStatusCodes['5']) === 1) {
				$advisedStatusCode = key($this->httpStatusCodes['5']);
			}
			else {
				// use a generic one
				$advisedStatusCode = 500;
			}
		}
		elseif (isset($this->httpStatusCodes['4'])) {
			if (count($this->httpStatusCodes['4']) === 1) {
				$advisedStatusCode = key($this->httpStatusCodes['4']);
			}
			else {
				// use a generic one
				$advisedStatusCode = 400;
			}
		}
		
		return (int) $advisedStatusCode;
	}
991384
public static HttpStatus fromStatusCode(final int statusCode)
	{
		if (statusCode < 100 || statusCode > 999)
		{
			throw new IllegalArgumentException("Illegal status code " + statusCode);
		}

		HttpStatus result = STATUS_CODES.get(statusCode);
		if (result == null)
		{
			return new HttpStatus(statusCode, "Unknown");
		}
		return result;
	}
1188419
protected function validateStatusCode($statusCode) : void
	{
		if (! \is_int($statusCode))
		{
			throw new \InvalidArgumentException('HTTP status-code must be an integer');
		}
		else if (! ($statusCode >= 100 && $statusCode <= 599))
		{
			throw new \InvalidArgumentException(\sprintf('The given status-code "%d" is not valid', $statusCode));
		}
	}