8000 feature #30729 [HttpKernel] change $previous argument for HttpExcepti… · symfony/symfony@e9e2f21 · GitHub
[go: up one dir, main page]

Skip to content

Commit e9e2f21

Browse files
committed
feature #30729 [HttpKernel] change $previous argument for HttpException to \Throwable (sGy1980de)
This PR was submitted for the 4.2 branch but it was squashed and merged into the 4.3-dev branch instead (closes #30729). Discussion ---------- [HttpKernel] change $previous argument for HttpException to \Throwable | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #30728 | License | MIT This will fix #30728 with the suggested solution to change the signature of `HttpException` and all its descendants from `\Exception` to `\Throwable`. Commits ------- 15cb475 [HttpKernel] change $previous argument for HttpException to \Throwable
2 parents 30b9617 + 15cb475 commit e9e2f21

32 files changed

+77
-59
lines changed

src/Symfony/Component/HttpKernel/Exception/AccessDeniedHttpException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ class AccessDeniedHttpException extends HttpException
1919
{
2020
/**
2121
* @param string $message The internal exception message
22-
* @param \Exception $previous The previous exception
22+
* @param \Throwable $previous The previous exception
2323
* @param int $code The internal exception code
2424
* @param array $headers
2525
*/
26-
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = [])
26+
public function __construct(string $message = null, \Throwable $previous = null, int $code = 0, array $headers = [])
2727
{
2828
parent::__construct(403, $message, $previous, $headers, $code);
2929
}

src/Symfony/Component/HttpKernel/Exception/BadRequestHttpException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1 802E 8,11 +18,11 @@ class BadRequestHttpException extends HttpException
1818
{
1919
/**
2020
* @param string $message The internal exception message
21-
* @param \Exception $previous The previous exception
21+
* @param \Throwable $previous The previous exception
2222
* @param int $code The internal exception code
2323
* @param array $headers
2424
*/
25-
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = [])
25+
public function __construct(string $message = null, \Throwable $previous = null, int $code = 0, array $headers = [])
2626
{
2727
parent::__construct(400, $message, $previous, $headers, $code);
2828
}

src/Symfony/Component/HttpKernel/Exception/ConflictHttpException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ class ConflictHttpException extends HttpException
1818
{
1919
/**
2020
* @param string $message The internal exception message
21-
* @param \Exception $previous The previous exception
21+
* @param \Throwable $previous The previous exception
2222
* @param int $code The internal exception code
2323
* @param array $headers
2424
*/
25-
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = [])
25+
public function __construct(string $message = null, \Throwable $previous = null, int $code = 0, array $headers = [])
2626
{
2727
parent::__construct(409, $message, $previous, $headers, $code);
2828
}

src/Symfony/Component/HttpKernel/Exception/GoneHttpException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ class GoneHttpException extends HttpException
1818
{
1919
/**
2020
* @param string $message The internal exception message
21-
* @param \Exception $previous The previous exception
21+
* @param \Throwable $previous The previous exception
2222
* @param int $code The internal exception code
2323
* @param array $headers
2424
*/
25-
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = [])
25+
public function __construct(string $message = null, \Throwable $previous = null, int $code = 0, array $headers = [])
2626
{
2727
parent::__construct(410, $message, $previous, $headers, $code);
2828
}

src/Symfony/Component/HttpKernel/Exception/HttpException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class HttpException extends \RuntimeException implements HttpExceptionInterface
2121
private $statusCode;
2222
private $headers;
2323

24-
public function __construct(int $statusCode, string $message = null, \Exception $previous = null, array $headers = [], ?int $code = 0)
24+
public function __construct(int $statusCode, string $message = null, \Throwable $previous = null, array $headers = [], ?int $code = 0)
2525
{
2626
$this->statusCode = $statusCode;
2727
$this->headers = $headers;

src/Symfony/Component/HttpKernel/Exception/LengthRequiredHttpException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ class LengthRequiredHttpException extends HttpException
1818
{
1919
/**
2020
* @param string $message The internal exception message
21-
* @param \Exception $previous The previous exception
21+
* @param \Throwable $previous The previous exception
2222
* @param int $code The internal exception code
2323
* @param array $headers
2424
*/
25-
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = [])
25+
public function __construct(string $message = null, \Throwable $previous = null, int $code = 0, array $headers = [])
2626
{
2727
parent::__construct(411, $message, $previous, $headers, $code);
2828
}

src/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ class MethodNotAllowedHttpException extends HttpException
1919
/**
2020
* @param array $allow An array of allowed methods
2121
* @param string $message The internal exception message
22-
* @param \Exception $previous The previous exception
22+
* @param \Throwable $previous The previous exception
2323
* @param int $code The internal exception code
2424
* @param array $headers
2525
*/
26-
public function __construct(array $allow, string $message = null, \Exception $previous = null, ?int $code = 0, array $headers = [])
26+
public function __construct(array $allow, string $message = null, \Throwable $previous = null, ?int $code = 0, array $headers = [])
2727
{
2828
$headers['Allow'] = strtoupper(implode(', ', $allow));
2929

src/Symfony/Component/HttpKernel/Exception/NotAcceptableHttpException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ class NotAcceptableHttpException extends HttpException
1818
{
1919
/**
2020
* @param string $message The internal exception message
21-
* @param \Exception $previous The previous exception
21+
* @param \Throwable $previous The previous exception
2222
* @param int $code The internal exception code
2323
* @param array $headers
2424
*/
25-
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = [])
25+
public function __construct(string $message = null, \Throwable $previous = null, int $code = 0, array $headers = [])
2626
{
2727
parent::__construct(406, $message, $previous, $headers, $code);
2828
}

src/Symfony/Component/HttpKernel/Exception/NotFoundHttpException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ class NotFoundHttpException extends HttpException
1818
{
1919
/**
2020
* @param string $message The internal exception message
21-
* @param \Exception $previous The previous exception
21+
* @param \Throwable $previous The previous exception
2222
* @param int $code The internal exception code
2323
* @param array $headers
2424
*/
25-
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = [])
25+
public function __construct(string $message = null, \Throwable $previous = null, int $code = 0, array $headers = [])
2626
{
2727
parent::__construct(404, $message, $previous, $headers, $code);
2828
}

src/Symfony/Component/HttpKernel/Exception/PreconditionFailedHttpException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ class PreconditionFailedHttpException extends HttpException
1818
{
1919
/**
2020
* @param string $message The internal exception message
21-
* @param \Exception $previous The previous exception
21+
* @param \Throwable $previous The previous exception
2222
* @param int $code The internal exception code
2323
* @param array $headers
2424
*/
25-
public function __construct(string $message = null, \Exception $previous = null, int $code = 0, array $headers = [])
25+
public function __construct(string $message = null, \Throwable $previous = null, int $code = 0, array $headers = [])
2626
{
2727
parent::__construct(412, $message, $previous, $headers, $code);
2828
}

0 commit comments

Comments
 (0)
0