Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 686e9b7

Browse files
feature #34332 Allow \Throwable $previous everywhere (fancyweb)
This PR was merged into the 4.4 branch. Discussion ---------- Allow \Throwable $previous everywhere | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- 59e044d Allow \Throwable $previous everywhere
2 parents d1d4bc8 + 59e044d commit 686e9b7

21 files changed

+24
-24
lines changed

src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ protected function stream(string $view, array $parameters = [], StreamedResponse
288288
*
289289
* @final
290290
*/
291-
protected function createNotFoundException(string $message = 'Not Found', \Exception $previous = null): NotFoundHttpException
291+
protected function createNotFoundException(string $message = 'Not Found', \Throwable $previous = null): NotFoundHttpException
292292
{
293293
return new NotFoundHttpException($message, $previous);
294294
}
@@ -304,7 +304,7 @@ protected function createNotFoundException(string $message = 'Not Found', \Excep
304304
*
305305
* @final
306306
*/
307-
protected function createAccessDeniedException(string $message = 'Access Denied.', \Exception $previous = null): AccessDeniedException
307+
protected function createAccessDeniedException(string $message = 'Access Denied.', \Throwable $previous = null): AccessDeniedException
308308
{
309309
if (!class_exists(AccessDeniedException::class)) {
310310
throw new \LogicException('You can not use the "createAccessDeniedException" method if the Security component is not available. Try running "composer require symfony/security-bundle".');

src/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class FileLoaderImportCircularReferenceException extends LoaderLoadException
2020
{
21-
public function __construct(array $resources, int $code = null, \Exception $previous = null)
21+
public function __construct(array $resources, int $code = null, \Throwable $previous = null)
2222
{
2323
$message = sprintf('Circular reference detected in "%s" ("%s" > "%s").', $this->varToString($resources[0]), implode('" > "', $resources), $resources[0]);
2424

src/Symfony/Component/Config/Exception/FileLocatorFileNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class FileLocatorFileNotFoundException extends \InvalidArgumentException
2020
{
2121
private $paths;
2222

23-
public function __construct(string $message = '', int $code = 0, \Exception $previous = null, array $paths = [])
23+
public function __construct(string $message = '', int $code = 0, \Throwable $previous = null, array $paths = [])
2424
{
2525
parent::__construct($message, $code, $previous);
2626

src/Symfony/Component/DependencyInjection/Exception/AutowiringFailedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class AutowiringFailedException extends RuntimeException
1919
private $serviceId;
2020
private $messageCallback;
2121

22-
public function __construct(string $serviceId, $message = '', int $code = 0, \Exception $previous = null)
22+
public function __construct(string $serviceId, $message = '', int $code = 0, \Throwable $previous = null)
2323
{
2424
$this->serviceId = $serviceId;
2525

src/Symfony/Component/DependencyInjection/Exception/EnvParameterException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class EnvParameterException extends InvalidArgumentException
2020
{
21-
public function __construct(array $envs, \Exception $previous = null, string $message = 'Incompatible use of dynamic environment variables "%s" found in parameters.')
21+
public function __construct(array $envs, \Throwable $previous = null, string $message = 'Incompatible use of dynamic environment variables "%s" found in parameters.')
2222
{
2323
parent::__construct(sprintf($message, implode('", "', $envs)), 0, $previous);
2424
}

src/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ParameterCircularReferenceException extends RuntimeException
2020
{
2121
private $parameters;
2222

23-
public function __construct(array $parameters, \Exception $previous = null)
23+
public function __construct(array $parameters, \Throwable $previous = null)
2424
{
2525
parent::__construct(sprintf('Circular reference detected for parameter "%s" ("%s" > "%s").', $parameters[0], implode('" > "', $parameters), $parameters[0]), 0, $previous);
2626

src/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ class ParameterNotFoundException extends InvalidArgumentException implements Not
3030
* @param string $key The requested parameter key
3131
* @param string $sourceId The service id that references the non-existent parameter
3232
* @param string $sourceKey The parameter key that references the non-existent parameter
33-
* @param \Exception $previous The previous exception
33+
* @param \Throwable $previous The previous exception
3434
* @param string[] $alternatives Some parameter name alternatives
3535
* @param string|null $nonNestedAlternative The alternative parameter name when the user expected dot notation for nested parameters
3636
*/
37-
public function __construct(string $key, string $sourceId = null, string $sourceKey = null, \Exception $previous = null, array $alternatives = [], string $nonNestedAlternative = null)
37+
public function __construct(string $key, string $sourceId = null, string $sourceKey = null, \Throwable $previous = null, array $alternatives = [], string $nonNestedAlternative = null)
3838
{
3939
$this->key = $key;
4040
$this->sourceId = $sourceId;

src/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ServiceCircularReferenceException extends RuntimeException
2121
private $serviceId;
2222
private $path;
2323

24-
public function __construct(string $serviceId, array $path, \Exception $previous = null)
24+
public function __construct(string $serviceId, array $path, \Throwable $previous = null)
2525
{
2626
parent::__construct(sprintf('Circular reference detected for service "%s", path: "%s".', $serviceId, implode(' -> ', $path)), 0, $previous);
2727

src/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ServiceNotFoundException extends InvalidArgumentException implements NotFo
2424
private $sourceId;
2525
private $alternatives;
2626

27-
public function __construct(string $id, string $sourceId = null, \Exception $previous = null, array $alternatives = [], string $msg = null)
27+
public function __construct(string $id, string $sourceId = null, \Throwable $previous = null, array $alternatives = [], string $msg = null)
2828
{
2929
if (null !== $msg) {
3030
// no-op

src/Symfony/Component/Dotenv/Exception/FormatException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class FormatException extends \LogicException implements ExceptionInterfac
2020
{
2121
private $context;
2222

23-
public function __construct(string $message, FormatExceptionContext $context, int $code = 0, \Exception $previous = null)
23+
public function __construct(string $message, FormatExceptionContext $context, int $code = 0, \Throwable $previous = null)
2424
{
2525
$this->context = $context;
2626

src/Symfony/Component/Dotenv/Exception/PathException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
final class PathException extends \RuntimeException implements ExceptionInterface
2020
{
21-
public function __construct(string $path, int $code = 0, \Exception $previous = null)
21+
public function __construct(string $path, int $code = 0, \Throwable $previous = null)
2222
{
2323
parent::__construct(sprintf('Unable to read the "%s" environment file.', $path), $code, $previous);
2424
}

src/Symfony/Component/Filesystem/Exception/FileNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
class FileNotFoundException extends IOException
2121
{
22-
public function __construct(string $message = null, int $code = 0, \Exception $previous = null, string $path = null)
22+
public function __construct(string $message = null, int $code = 0, \Throwable $previous = null, string $path = null)
2323
{
2424
if (null === $message) {
2525
if (null === $path) {

src/Symfony/Component/Filesystem/Exception/IOException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class IOException extends \RuntimeException implements IOExceptionInterface
2222
{
2323
private $path;
2424

25-
public function __construct(string $message, int $code = 0, \Exception $previous = null, string $path = null)
25+
public function __construct(string $message, int $code = 0, \Throwable $previous = null, string $path = null)
2626
{
2727
$this->path = $path;
2828

src/Symfony/Component/Mailer/Exception/HttpTransportException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class HttpTransportException extends TransportException
2020
{
2121
private $response;
2222

23-
public function __construct(string $message = null, ResponseInterface $response, int $code = 0, \Exception $previous = null)
23+
public function __construct(string $message = null, ResponseInterface $response, int $code = 0, \Throwable $previous = null)
2424
{
2525
parent::__construct($message, $code, $previous);
2626

src/Symfony/Component/Routing/Exception/MethodNotAllowedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class MethodNotAllowedException extends \RuntimeException implements ExceptionIn
2222
{
2323
protected $allowedMethods = [];
2424

25-
public function __construct(array $allowedMethods, string $message = null, int $code = 0, \Exception $previous = null)
25+
public function __construct(array $allowedMethods, string $message = null, int $code = 0, \Throwable $previous = null)
2626
{
2727
$this->allowedMethods = array_map('strtoupper', $allowedMethods);
2828

src/Symfony/Component/Security/Core/Exception/AccessDeniedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class AccessDeniedException extends RuntimeException
2121
private $attributes = [];
2222
private $subject;
2323

24-
public function __construct(string $message = 'Access Denied.', \Exception $previous = null)
24+
public function __construct(string $message = 'Access Denied.', \Throwable $previous = null)
2525
{
2626
parent::__construct($message, 403, $previous);
2727
}

src/Symfony/Component/Security/Core/Exception/CustomUserMessageAuthenticationException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CustomUserMessageAuthenticationException extends AuthenticationException
2626

2727
private $messageData = [];
2828

29-
public function __construct(string $message = '', array $messageData = [], int $code = 0, \Exception $previous = null)
29+
public function __construct(string $message = '', array $messageData = [], int $code = 0, \Throwable $previous = null)
3030
{
3131
parent::__construct($message, $code, $previous);
3232

src/Symfony/Component/Security/Core/Exception/LogoutException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class LogoutException extends RuntimeException
2020
{
21-
public function __construct(string $message = 'Logout Exception', \Exception $previous = null)
21+
public function __construct(string $message = 'Logout Exception', \Throwable $previous = null)
2222
{
2323
parent::__construct($message, 403, $previous);
2424
}

src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ExtraAttributesException extends RuntimeException
2020
{
2121
private $extraAttributes;
2222

23-
public function __construct(array $extraAttributes, \Exception $previous = null)
23+
public function __construct(array $extraAttributes, \Throwable $previous = null)
2424
{
2525
$msg = sprintf('Extra attributes are not allowed ("%s" are unknown).', implode('", "', $extraAttributes));
2626

src/Symfony/Component/VarDumper/Exception/ThrowingCasterException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
class ThrowingCasterException extends \Exception
1818
{
1919
/**
20-
* @param \Exception $prev The exception thrown from the caster
20+
* @param \Throwable $prev The exception thrown from the caster
2121
*/
22-
public function __construct(\Exception $prev)
22+
public function __construct(\Throwable $prev)
2323
{
2424
parent::__construct('Unexpected '.\get_class($prev).' thrown from a caster: '.$prev->getMessage(), 0, $prev);
2525
}

src/Symfony/Component/Yaml/Exception/ParseException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ParseException extends RuntimeException
3030
* @param string|null $parsedFile The file name where the error occurred
3131
* @param \Exception|null $previous The previous exception
3232
*/
33-
public function __construct(string $message, int $parsedLine = -1, string $snippet = null, string $parsedFile = null, \Exception $previous = null)
33+
public function __construct(string $message, int $parsedLine = -1, string $snippet = null, string $parsedFile = null, \Throwable $previous = null)
3434
{
3535
$this->parsedFile = $parsedFile;
3636
$this->parsedLine = $parsedLine;

0 commit comments

Comments
 (0)