mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-15 04:27:14 +01:00
24 lines
719 B
PHP
24 lines
719 B
PHP
<?php
|
|
|
|
namespace Xentral\Components\Http\Exception;
|
|
|
|
use RuntimeException;
|
|
use Throwable;
|
|
|
|
class HttpHeaderValueException extends RuntimeException implements HttpComponentExceptionInterface
|
|
{
|
|
public function __construct($message = '', $code = 0, Throwable $previous = null, $headerValue = null)
|
|
{
|
|
$headerString = '';
|
|
if ($headerValue === null) {
|
|
$headerString = 'null';
|
|
}
|
|
if (is_array($headerValue)) {
|
|
$headerString = sprintf('[%s]', implode(',', $headerValue));
|
|
}
|
|
$headerString = strval($headerString);
|
|
$message = sprintf('%s value:"%s"', $message, $headerString);
|
|
|
|
parent::__construct($message, $code, $previous);
|
|
}
|
|
} |