updated-packages
This commit is contained in:
@@ -18,12 +18,11 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class AccessDeniedHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
*/
|
||||
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = array())
|
||||
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
parent::__construct(403, $message, $previous, $headers, $code);
|
||||
}
|
||||
|
@@ -17,12 +17,11 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class BadRequestHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
*/
|
||||
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = array())
|
||||
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
parent::__construct(400, $message, $previous, $headers, $code);
|
||||
}
|
||||
|
@@ -17,12 +17,11 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class ConflictHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
*/
|
||||
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = array())
|
||||
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
parent::__construct(409, $message, $previous, $headers, $code);
|
||||
}
|
||||
|
@@ -28,17 +28,17 @@ class ControllerDoesNotReturnResponseException extends \LogicException
|
||||
$this->line = $controllerDefinition['line'];
|
||||
$r = new \ReflectionProperty(\Exception::class, 'trace');
|
||||
$r->setAccessible(true);
|
||||
$r->setValue($this, array_merge(array(
|
||||
array(
|
||||
$r->setValue($this, array_merge([
|
||||
[
|
||||
'line' => $line,
|
||||
'file' => $file,
|
||||
),
|
||||
), $this->getTrace()));
|
||||
],
|
||||
], $this->getTrace()));
|
||||
}
|
||||
|
||||
private function parseControllerDefinition(callable $controller): ?array
|
||||
{
|
||||
if (\is_string($controller) && false !== strpos($controller, '::')) {
|
||||
if (\is_string($controller) && str_contains($controller, '::')) {
|
||||
$controller = explode('::', $controller);
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ class ControllerDoesNotReturnResponseException extends \LogicException
|
||||
try {
|
||||
$r = new \ReflectionMethod($controller[0], $controller[1]);
|
||||
|
||||
return array(
|
||||
return [
|
||||
'file' => $r->getFileName(),
|
||||
'line' => $r->getEndLine(),
|
||||
);
|
||||
];
|
||||
} catch (\ReflectionException $e) {
|
||||
return null;
|
||||
}
|
||||
@@ -58,19 +58,25 @@ class ControllerDoesNotReturnResponseException extends \LogicException
|
||||
if ($controller instanceof \Closure) {
|
||||
$r = new \ReflectionFunction($controller);
|
||||
|
||||
return array(
|
||||
return [
|
||||
'file' => $r->getFileName(),
|
||||
'line' => $r->getEndLine(),
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
if (\is_object($controller)) {
|
||||
$r = new \ReflectionClass($controller);
|
||||
|
||||
return array(
|
||||
try {
|
||||
$line = $r->getMethod('__invoke')->getEndLine();
|
||||
} catch (\ReflectionException $e) {
|
||||
$line = $r->getEndLine();
|
||||
}
|
||||
|
||||
return [
|
||||
'file' => $r->getFileName(),
|
||||
'line' => $r->getEndLine(),
|
||||
);
|
||||
'line' => $line,
|
||||
];
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@@ -17,12 +17,11 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class GoneHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
*/
|
||||
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = array())
|
||||
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
parent::__construct(410, $message, $previous, $headers, $code);
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ class HttpException extends \RuntimeException implements HttpExceptionInterface
|
||||
private $statusCode;
|
||||
private $headers;
|
||||
|
||||
public function __construct(int $statusCode, string $message = null, \Exception $previous = null, array $headers = array(), ?int $code = 0)
|
||||
public function __construct(int $statusCode, ?string $message = '', \Throwable $previous = null, array $headers = [], ?int $code = 0)
|
||||
{
|
||||
$this->statusCode = $statusCode;
|
||||
$this->headers = $headers;
|
||||
|
@@ -16,7 +16,7 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
*
|
||||
* @author Kris Wallsmith <kris@symfony.com>
|
||||
*/
|
||||
interface HttpExceptionInterface
|
||||
interface HttpExceptionInterface extends \Throwable
|
||||
{
|
||||
/**
|
||||
* Returns the status code.
|
||||
|
@@ -17,12 +17,11 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class LengthRequiredHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
*/
|
||||
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = array())
|
||||
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
parent::__construct(411, $message, $previous, $headers, $code);
|
||||
}
|
||||
|
@@ -17,13 +17,12 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class MethodNotAllowedHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param array $allow An array of allowed methods
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param string[] $allow An array of allowed methods
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int|null $code The internal exception code
|
||||
*/
|
||||
public function __construct(array $allow, string $message = null, \Exception $previous = null, ?int $code = 0, array $headers = array())
|
||||
public function __construct(array $allow, ?string $message = '', \Throwable $previous = null, ?int $code = 0, array $headers = [])
|
||||
{
|
||||
$headers['Allow'] = strtoupper(implode(', ', $allow));
|
||||
|
||||
|
@@ -17,12 +17,11 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class NotAcceptableHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
*/
|
||||
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = array())
|
||||
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
parent::__construct(406, $message, $previous, $headers, $code);
|
||||
}
|
||||
|
@@ -17,12 +17,11 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class NotFoundHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
*/
|
||||
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = array())
|
||||
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
parent::__construct(404, $message, $previous, $headers, $code);
|
||||
}
|
||||
|
@@ -17,12 +17,11 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class PreconditionFailedHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
*/
|
||||
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = array())
|
||||
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
parent::__construct(412, $message, $previous, $headers, $code);
|
||||
}
|
||||
|
@@ -19,12 +19,11 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class PreconditionRequiredHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
*/
|
||||
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = array())
|
||||
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
parent::__construct(428, $message, $previous, $headers, $code);
|
||||
}
|
||||
|
@@ -17,13 +17,12 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class ServiceUnavailableHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param int|string $retryAfter The number of seconds or HTTP-date after which the request may be retried
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param int|string|null $retryAfter The number of seconds or HTTP-date after which the request may be retried
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int|null $code The internal exception code
|
||||
*/
|
||||
public function __construct($retryAfter = null, string $message = null, \Exception $previous = null, ?int $code = 0, array $headers = array())
|
||||
public function __construct($retryAfter = null, ?string $message = '', \Throwable $previous = null, ?int $code = 0, array $headers = [])
|
||||
{
|
||||
if ($retryAfter) {
|
||||
$headers['Retry-After'] = $retryAfter;
|
||||
|
@@ -19,13 +19,12 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class TooManyRequestsHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param int|string $retryAfter The number of seconds or HTTP-date after which the request may be retried
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param int|string|null $retryAfter The number of seconds or HTTP-date after which the request may be retried
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int|null $code The internal exception code
|
||||
*/
|
||||
public function __construct($retryAfter = null, string $message = null, \Exception $previous = null, ?int $code = 0, array $headers = array())
|
||||
public function __construct($retryAfter = null, ?string $message = '', \Throwable $previous = null, ?int $code = 0, array $headers = [])
|
||||
{
|
||||
if ($retryAfter) {
|
||||
$headers['Retry-After'] = $retryAfter;
|
||||
|
@@ -17,13 +17,12 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class UnauthorizedHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param string $challenge WWW-Authenticate challenge string
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param string $challenge WWW-Authenticate challenge string
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int|null $code The internal exception code
|
||||
*/
|
||||
public function __construct(string $challenge, string $message = null, \Exception $previous = null, ?int $code = 0, array $headers = array())
|
||||
public function __construct(string $challenge, ?string $message = '', \Throwable $previous = null, ?int $code = 0, array $headers = [])
|
||||
{
|
||||
$headers['WWW-Authenticate'] = $challenge;
|
||||
|
||||
|
@@ -17,12 +17,11 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class UnprocessableEntityHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
*/
|
||||
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = array())
|
||||
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
parent::__construct(422, $message, $previous, $headers, $code);
|
||||
}
|
||||
|
@@ -17,12 +17,11 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class UnsupportedMediaTypeHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @param string $message The internal exception message
|
||||
* @param \Exception $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
* @param array $headers
|
||||
* @param string|null $message The internal exception message
|
||||
* @param \Throwable|null $previous The previous exception
|
||||
* @param int $code The internal exception code
|
||||
*/
|
||||
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = array())
|
||||
public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
parent::__construct(415, $message, $previous, $headers, $code);
|
||||
}
|
||||
|
Reference in New Issue
Block a user