package and depencies
This commit is contained in:
@@ -17,19 +17,8 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
*/
|
||||
class AccessDeniedHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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 = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
|
||||
parent::__construct(403, $message, $previous, $headers, $code);
|
||||
}
|
||||
}
|
||||
|
@@ -16,19 +16,8 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
*/
|
||||
class BadRequestHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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 = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
|
||||
parent::__construct(400, $message, $previous, $headers, $code);
|
||||
}
|
||||
}
|
||||
|
@@ -16,19 +16,8 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
*/
|
||||
class ConflictHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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 = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
|
||||
parent::__construct(409, $message, $previous, $headers, $code);
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@ class ControllerDoesNotReturnResponseException extends \LogicException
|
||||
$this->file = $controllerDefinition['file'];
|
||||
$this->line = $controllerDefinition['line'];
|
||||
$r = new \ReflectionProperty(\Exception::class, 'trace');
|
||||
$r->setAccessible(true);
|
||||
$r->setValue($this, array_merge([
|
||||
[
|
||||
'line' => $line,
|
||||
@@ -50,7 +49,7 @@ class ControllerDoesNotReturnResponseException extends \LogicException
|
||||
'file' => $r->getFileName(),
|
||||
'line' => $r->getEndLine(),
|
||||
];
|
||||
} catch (\ReflectionException $e) {
|
||||
} catch (\ReflectionException) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -69,7 +68,7 @@ class ControllerDoesNotReturnResponseException extends \LogicException
|
||||
|
||||
try {
|
||||
$line = $r->getMethod('__invoke')->getEndLine();
|
||||
} catch (\ReflectionException $e) {
|
||||
} catch (\ReflectionException) {
|
||||
$line = $r->getEndLine();
|
||||
}
|
||||
|
||||
|
@@ -16,19 +16,8 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
*/
|
||||
class GoneHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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 = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
|
||||
parent::__construct(410, $message, $previous, $headers, $code);
|
||||
}
|
||||
}
|
||||
|
@@ -18,43 +18,27 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
*/
|
||||
class HttpException extends \RuntimeException implements HttpExceptionInterface
|
||||
{
|
||||
private $statusCode;
|
||||
private $headers;
|
||||
private int $statusCode;
|
||||
private array $headers;
|
||||
|
||||
public function __construct(int $statusCode, ?string $message = '', \Throwable $previous = null, array $headers = [], ?int $code = 0)
|
||||
public function __construct(int $statusCode, string $message = '', \Throwable $previous = null, array $headers = [], int $code = 0)
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
if (null === $code) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $code to "%s()" is deprecated, pass 0 instead.', __METHOD__);
|
||||
|
||||
$code = 0;
|
||||
}
|
||||
|
||||
$this->statusCode = $statusCode;
|
||||
$this->headers = $headers;
|
||||
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
public function getStatusCode()
|
||||
public function getStatusCode(): int
|
||||
{
|
||||
return $this->statusCode;
|
||||
}
|
||||
|
||||
public function getHeaders()
|
||||
public function getHeaders(): array
|
||||
{
|
||||
return $this->headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set response headers.
|
||||
*
|
||||
* @param array $headers Response headers
|
||||
*/
|
||||
public function setHeaders(array $headers)
|
||||
{
|
||||
$this->headers = $headers;
|
||||
|
@@ -20,15 +20,11 @@ interface HttpExceptionInterface extends \Throwable
|
||||
{
|
||||
/**
|
||||
* Returns the status code.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getStatusCode();
|
||||
public function getStatusCode(): int;
|
||||
|
||||
/**
|
||||
* Returns response headers.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getHeaders();
|
||||
public function getHeaders(): array;
|
||||
}
|
||||
|
@@ -16,19 +16,8 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
*/
|
||||
class LengthRequiredHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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 = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
|
||||
parent::__construct(411, $message, $previous, $headers, $code);
|
||||
}
|
||||
}
|
||||
|
23
vendor/symfony/http-kernel/Exception/LockedHttpException.php
vendored
Normal file
23
vendor/symfony/http-kernel/Exception/LockedHttpException.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* @author Peter Dietrich <xosofox@gmail.com>
|
||||
*/
|
||||
class LockedHttpException extends HttpException
|
||||
{
|
||||
public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
parent::__construct(423, $message, $previous, $headers, $code);
|
||||
}
|
||||
}
|
@@ -17,24 +17,10 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class MethodNotAllowedHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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
|
||||
* @param string[] $allow An array of allowed methods
|
||||
*/
|
||||
public function __construct(array $allow, ?string $message = '', \Throwable $previous = null, ?int $code = 0, array $headers = [])
|
||||
public function __construct(array $allow, string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
if (null === $code) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $code to "%s()" is deprecated, pass 0 instead.', __METHOD__);
|
||||
|
||||
$code = 0;
|
||||
}
|
||||
|
||||
$headers['Allow'] = strtoupper(implode(', ', $allow));
|
||||
|
||||
parent::__construct(405, $message, $previous, $headers, $code);
|
||||
|
@@ -16,19 +16,8 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
*/
|
||||
class NotAcceptableHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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 = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
|
||||
parent::__construct(406, $message, $previous, $headers, $code);
|
||||
}
|
||||
}
|
||||
|
@@ -16,19 +16,8 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
*/
|
||||
class NotFoundHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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 = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
|
||||
parent::__construct(404, $message, $previous, $headers, $code);
|
||||
}
|
||||
}
|
||||
|
@@ -16,19 +16,8 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
*/
|
||||
class PreconditionFailedHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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 = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
|
||||
parent::__construct(412, $message, $previous, $headers, $code);
|
||||
}
|
||||
}
|
||||
|
@@ -18,19 +18,8 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
*/
|
||||
class PreconditionRequiredHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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 = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
|
||||
parent::__construct(428, $message, $previous, $headers, $code);
|
||||
}
|
||||
}
|
||||
|
@@ -18,23 +18,9 @@ class ServiceUnavailableHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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 = '', \Throwable $previous = null, ?int $code = 0, array $headers = [])
|
||||
public function __construct(int|string $retryAfter = null, string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
if (null === $code) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $code to "%s()" is deprecated, pass 0 instead.', __METHOD__);
|
||||
|
||||
$code = 0;
|
||||
}
|
||||
|
||||
if ($retryAfter) {
|
||||
$headers['Retry-After'] = $retryAfter;
|
||||
}
|
||||
|
@@ -20,23 +20,9 @@ class TooManyRequestsHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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 = '', \Throwable $previous = null, ?int $code = 0, array $headers = [])
|
||||
public function __construct(int|string $retryAfter = null, string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
if (null === $code) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $code to "%s()" is deprecated, pass 0 instead.', __METHOD__);
|
||||
|
||||
$code = 0;
|
||||
}
|
||||
|
||||
if ($retryAfter) {
|
||||
$headers['Retry-After'] = $retryAfter;
|
||||
}
|
||||
|
@@ -17,24 +17,10 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
class UnauthorizedHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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
|
||||
* @param string $challenge WWW-Authenticate challenge string
|
||||
*/
|
||||
public function __construct(string $challenge, ?string $message = '', \Throwable $previous = null, ?int $code = 0, array $headers = [])
|
||||
public function __construct(string $challenge, string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
if (null === $code) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $code to "%s()" is deprecated, pass 0 instead.', __METHOD__);
|
||||
|
||||
$code = 0;
|
||||
}
|
||||
|
||||
$headers['WWW-Authenticate'] = $challenge;
|
||||
|
||||
parent::__construct(401, $message, $previous, $headers, $code);
|
||||
|
@@ -16,19 +16,8 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
*/
|
||||
class UnprocessableEntityHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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 = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
|
||||
parent::__construct(422, $message, $previous, $headers, $code);
|
||||
}
|
||||
}
|
||||
|
@@ -16,19 +16,8 @@ namespace Symfony\Component\HttpKernel\Exception;
|
||||
*/
|
||||
class UnsupportedMediaTypeHttpException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @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 = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
|
||||
{
|
||||
if (null === $message) {
|
||||
trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);
|
||||
|
||||
$message = '';
|
||||
}
|
||||
|
||||
parent::__construct(415, $message, $previous, $headers, $code);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user